Commit Graph

22 Commits

Author SHA1 Message Date
LuK1337
c62a9fbc31 repopick: Print change subject as unicode
* This prevents from seeing stuff like
  "b'frameworks: Add unlinked ringtone and notification volumes'"
  when using python3 as default.

Change-Id: Ie1fa85681b648edcee65680d784da4dff1779616
2019-09-21 11:48:49 +02:00
Luca Weiss
5ee35ea356 repopick: cmp() is not available in Python 3, define it manually
Change-Id: I16a89aa555e62f105d888e87cb43afd26606076b
2019-06-08 00:01:05 +02:00
Tim Schumacher
49d26ba39a repopick: Try to fast-forward first
Change-Id: I4890ce8075556eb3f57d89c283543f620f39fa02
2018-10-27 21:57:56 +02:00
Adrian DC
0f8230b528 repopick: Warn about empty commits instead of failing
* If a cherry-pick results in an empty commit
    (hints about git commit --allow-empty),
    we should warn instead of failing all repopicks

Change-Id: I8410d7d02c4118c8072de609cf3c291e2d8523e6
2018-09-05 22:41:06 +02:00
Gabriele M
0fcc122018 repopick: Update SSH queries result to match HTTP queries
Needed after the recent repopick changes.

Change-Id: I14f57afefeb9579d1d9896d8dc4512645b5b68e9
2018-06-11 22:52:51 +02:00
Gabriele M
af970b695c repopick: Allow to pick changes by URL
Change-Id: I460c987cc03c4f6ff03ecab1bc39e52cec413c13
2018-04-05 17:34:16 +02:00
Gabriele M
88c0e5d1af repopick: Actually print the patchset number
We are printing the change number twice...

Change-Id: I4f63766d4162f5d016badad662842badd6da3588
2018-04-05 17:34:15 +02:00
Gabriele M
de9e0ae0a5 repopick: Ignore the trailing slash in change numbers
Trailing slashes cause 'patchset' to be an empty string, which
cannot be converted to an int. If we have a trailing slash, ignore
it and pick the current patchset.

Change-Id: Ifad60b7f6ff3dcfd9dd80b2e93b1f909aa360666
2018-04-05 17:34:15 +02:00
Gabriele M
5b610aede3 repopick: Try to keep the changes sorted
Sort the changes according to their parent first and then according
to their number.

Change-Id: Iebdb8789728b2ccd528e19437e162129eb27973c
2018-04-05 17:34:14 +02:00
nailyk
8ce26b3b51 tools: repopick: Correctly order changeset
* Without key=int sorting is done in alphabetical order.
       This cause 999 being picked after 1000.

Change-Id: I540f0e55093a33d80d78a0cf0c31dc83f7168279
2018-01-05 10:16:45 +00:00
Dan Pasanen
1cdd380e69 repopick: support auth'ing to gerrit and picking drafts
* Use requests if installed. If not fall back to urllib. This is
  done because users may or may not have requests installed and
  requiring them to do so for simple http stuff isn't really
  reasonable.

* If requests is installed and a .gerritrc file exists in the
  user's HOME directory, try to get credentials out of it
  for the given gerrit instance. If auth for the correct gerrit
  instance exists, use it to auth to gerrit. If no .gerritrc
  exists, just use requests with no auth.

  Example ~/.gerritrc entry:
  review.lineageos.org|invisiblek|httppasswordhere

Change-Id: I95be26d51bfd31b53f3613e8dbfb7bba46324571
2017-12-21 00:11:43 +00:00
Dan Pasanen
2965342b9a repopick: use https by default for repopicking
Change-Id: Iae1fde3515b0377a2b9253102c82d28b0fdaca4a
2017-12-15 16:50:12 +00:00
Adrian DC
df29022a38 repopick: Support overriding the default commits count to check
* Support passing -c 20 to consider 20 changes instead of 10

Change-Id: I2b36228fb0020501896c800b13713aef284a5772
2017-11-28 09:41:19 +00:00
Harry Youd
1c9c5a314d repopick: Add 'reset' option
In case of conflict, reset to initial state by aborting the cherry-pick,
leaving the working directory clean

Change-Id: I2353b92254b67ea49835bc88b6fc9bc3910b5107
2017-07-19 10:15:32 +00:00
Dan Pasanen
63f767edd9 repopick: don't bail on drafts
* When using an ssh gerrit instance (-g) it is perfectly
  reasonable to pick a draft commit. Don't require force
  picking (-f) in order to do so.

Change-Id: I420f566ee1bb1f0b0d2a2ef29d95e0545db70b89
2017-07-09 09:41:34 -05:00
LuK1337
ad5d9a0ff0 cm: build: Don't convert patchset to int if it's None
* donuts *

Change-Id: I65bfb1741481b01874f21d83b5a43b0902b7d8ea
2017-03-24 23:25:44 +01:00
LuK1337
2756418873 cm: build: Fix cherry picking specific patchsets
Change-Id: I396a1218f141a1ff4cb45252cc01a1487c2afd31
2017-03-24 21:49:55 +00:00
Dan Pasanen
d4ee2f6d04 repopick: encode commit subjects in utf-8 for printing
* Fixes errors like UnicodeEncodeError: 'ascii' codec can't encode
  character u'\xb0' in position 51: ordinal not in range(128) with weird
  characters in a commit message

Change-Id: I700198481630b4b29fd6d5d1f0c79bb94e59ad86
2017-03-16 20:30:41 +00:00
Dan Pasanen
0fdc085c2e build: repopick: point to LineageOS gerrit
Change-Id: Ibf58b111360c17cee919efd585f5ec48be1e2eec
2016-12-27 10:32:16 -06:00
Adrian DC
13b02ff101 repopick: Avoid failing on commits lookup
* Some projects with multiple merges and
    discountinuous histories could trigger
    an error here when the HEAD~{?} does
    not exist, hence avoid this by ignoring
    the commit and continue the search

Change-Id: Ice28c87d1bf8897da52236b637bbb0c5d349f848
2016-12-10 11:03:57 -08:00
Simon Shields
2bdb18f3cd repopick: fix indentation derp
Change-Id: I0673779363b1963219a2765399f2e20c9cdd78a8
2016-09-26 17:52:03 +10:00
Michael Bestas
3952f6cb0d Import CM build additions
Change-Id: Id1eb902129754e61dfcc2b5d95c3a75172ff0c5e
2016-09-25 22:32:37 -07:00