Tue, 20 Jun 2017 23:22:38 -0700 patch: rewrite reversehunks (issue5337)
Jun Wu <quark@fb.com> [Tue, 20 Jun 2017 23:22:38 -0700] rev 32997
patch: rewrite reversehunks (issue5337) The old reversehunks code accesses "crecord.uihunk._hunk", which is the raw recordhunk without crecord selection information, therefore "revert -i" cannot revert individual lines, aka. issue5337. The patch rewrites related logic to return the right reverse hunk for revert. Namely, 1. "fromline" and "toline" are correctly swapped [1] 2. crecord.uihunk generates a correct reverse hunk [2] Besides, reversehunks(hunks) will no longer modify its input "hunks", which is more expected. [1]: To explain why "fromline" and "toline" need to be swapped, take the following example: $ cat > a <<EOF > 1 > 2 > 3 > 4 > EOF $ cat > b <<EOF > 2 > 3 > 5 > EOF $ diff a b 1d0 <---- "1" is "fromline" and "0" is "toline" < 1 and they are swapped if diff from the reversed direction 4c3 | < 4 | --- | > 5 | | $ diff b a | 0a1 <---------+ > 1 3c4 <---- also "4c3" gets swapped to "3c4" < 5 --- > 4 [2]: This is a bit tricky. For example, given a file which is empty in working parent but has 3 lines in working copy, and the user selection: select hunk to discard [x] +1 [ ] +2 [x] +3 The user intent is to drop "1" and "3" in working copy but keep "2", so the reverse patch would be something like: -1 2 (2 is a "context line") -3 We cannot just take all selected lines and swap "-" and "+", which will be: -1 -3 That patch won't apply because of "2". So the correct way is to insert "2" as a "context line" by inserting it first then deleting it: -2 +2 Therefore, the correct revert patch is: -1 -2 +2 -3 It could be reordered to look more like a common diff hunk: -1 -2 -3 +2 Note: It's possible to return multiple hunks so there won't be lines like "-2", "+2". But the current implementation is much simpler. For deletions, like the working parent has "1\n2\n3\n" and it was changed to empty in working copy: select hunk to discard [x] -1 [ ] -2 [x] -3 The user intent is to drop the deletion of 1 and 3 (in other words, keep those lines), but still delete "2". The reverse patch is meant to be applied to working copy which is empty. So the patch would be: +1 +3 That is to say, there is no need to special handle the unselected "2" like the above insertion case.
Wed, 21 Jun 2017 10:46:18 +0200 profiling: cope with configwith default value handling changes
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 21 Jun 2017 10:46:18 +0200] rev 32996
profiling: cope with configwith default value handling changes Changeset 6ff6eb33f353 change 'configwith' behavior so that the default value is run through the conversion function. In parallel a new user of 'configwith' got introduced unaware of this coming behavior change. This broke profiling. We resolve the situation by having the new conversion function cope with a default value already using the right type.
Tue, 20 Jun 2017 14:00:41 -0700 py3: catch StopIteration from next() in generatorset
Martin von Zweigbergk <martinvonz@google.com> [Tue, 20 Jun 2017 14:00:41 -0700] rev 32995
py3: catch StopIteration from next() in generatorset IIUC, letting the StopIteration through would not cause any bugs, but not doing it makes the test-py3-commands.t pass. I have also diligently gone through all uses of next() in our code base. They either: * are not called from a generator * pass a default value to next() * catch StopException * work on infinite iterators * request a fixed number of items that matches the generated number * are about batching in wireproto which I didn't quite follow I'd appreciate if Augie or someone else could take a look at the wireproto batching and convince themselves that the next(batchable) calls there will not raise a StopIteration.
Tue, 20 Jun 2017 23:23:45 -0400 tests: adjust quoting to keep Windows happy with recent $PYTHON change
Matt Harbison <matt_harbison@yahoo.com> [Tue, 20 Jun 2017 23:23:45 -0400] rev 32994
tests: adjust quoting to keep Windows happy with recent $PYTHON change I tried adding quotes to the $PYTHON variable, and also tried converting the path from the current 'c:/Python/python.exe' form to '/c/python/python.exe', but neither worked. I'm not sure why one of these needs '\"' around the variable and the other doesn't.
Tue, 20 Jun 2017 16:33:13 -0700 bundle2: don't use debug message "no-transaction" with transaction
Martin von Zweigbergk <martinvonz@google.com> [Tue, 20 Jun 2017 16:33:13 -0700] rev 32993
bundle2: don't use debug message "no-transaction" with transaction
Wed, 21 Jun 2017 02:20:34 +0530 py3: use pycompat.bytestr() in place of str()
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 21 Jun 2017 02:20:34 +0530] rev 32992
py3: use pycompat.bytestr() in place of str()
Wed, 21 Jun 2017 02:13:34 +0530 py3: use r'' to access values from kwargs where keys are str
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 21 Jun 2017 02:13:34 +0530] rev 32991
py3: use r'' to access values from kwargs where keys are str These are the cases where either args is again passed as keyword argument or 1 or 2 elements are accessed. So it's better to add an r'' to prevent it converting to bytes rather than doing the conversion of args.
Wed, 21 Jun 2017 02:10:25 +0530 py3: convert keys of kwargs in template keywords functions to bytes
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 21 Jun 2017 02:10:25 +0530] rev 32990
py3: convert keys of kwargs in template keywords functions to bytes This patch converts the args argument keys' to bytes wherever necessary as there are some places where either args is not used or using r'' is better or args is again passed as keyword arguments.
Tue, 20 Jun 2017 23:50:50 +0530 py3: make sure the commands name are bytes in test-devel-warnings.t
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 20 Jun 2017 23:50:50 +0530] rev 32989
py3: make sure the commands name are bytes in test-devel-warnings.t
Tue, 20 Jun 2017 23:46:18 +0530 py3: replace str with bytes in isinstance()
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 20 Jun 2017 23:46:18 +0530] rev 32988
py3: replace str with bytes in isinstance() We were using str because on Python 2, str were bytes but now we have to use bytes. Otherwise the if conditions fails and we have weird results from commands on Python 3.
Tue, 20 Jun 2017 22:11:46 +0530 py3: catch binascii.Error raised from binascii.unhexlify
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 20 Jun 2017 22:11:46 +0530] rev 32987
py3: catch binascii.Error raised from binascii.unhexlify Before Python 3, binsacii.unhexlify used to raise TypeError, now it raises binascii.Error.
Tue, 20 Jun 2017 23:39:59 -0700 shelve: allow unlimited shelved changes per name
Jun Wu <quark@fb.com> [Tue, 20 Jun 2017 23:39:59 -0700] rev 32986
shelve: allow unlimited shelved changes per name Previously, there is a 100 changes limit per name (bookmark or named branch). And the user will get "too many shelved changes named %s" when they are trying to shelve the 101th change. I hit that error message today. This limit was introduced by the shelve extension since the beginning. The function generating the names was called "gennames", under "getshelvename". There is another "gennames" under "backupfilename": def backupfilename(self): def gennames(base): yield base base, ext = base.rsplit('.', 1) for i in itertools.count(1): yield '%s-%d.%s' % (base, i, ext) "itertools.count" is an endless counter. Since the other "gennames" generates unlimited number of names, and the changeset introducing the limit (49d4919d21) does not say why the limit is useful. It seems safe to just remove the limit. The format "%02d" was kept intentionally so existing shelved changes won't break.
Sat, 17 Jun 2017 12:51:37 +0200 config: use the new '_unset' value for 'configsuboptions'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 12:51:37 +0200] rev 32985
config: use the new '_unset' value for 'configsuboptions' This should let configsuboptions delegate all special processing of the default config value to the main 'config' method.
Sat, 17 Jun 2017 18:28:20 +0200 config: use the 'config' method in 'configsuboptions'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 18:28:20 +0200] rev 32984
config: use the 'config' method in 'configsuboptions' There was unnecessary code duplication. It was getting in the way of the unification of the default value logic.
Sat, 17 Jun 2017 12:52:02 +0200 config: use the new '_unset' value for 'configpath'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 12:52:02 +0200] rev 32983
config: use the new '_unset' value for 'configpath' This should let 'configpath' delegate all special processing of the default config value to the main 'config' method.
Sat, 17 Jun 2017 12:54:45 +0200 config: use the new '_unset' value for 'configdate'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 12:54:45 +0200] rev 32982
config: use the new '_unset' value for 'configdate' This should let 'configdate' delegate all special processing of the default config value to the main 'config' method. The default value for date (None) is still enforced in this method if no other default were passed.
Sat, 17 Jun 2017 12:54:04 +0200 config: use the new '_unset' value for 'configlist'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 12:54:04 +0200] rev 32981
config: use the new '_unset' value for 'configlist' This should let 'configlist' delegate all special processing of the default config value to the main 'config' method. The default config value ([]) is still handled in this method.
Sat, 17 Jun 2017 12:53:51 +0200 config: use the new '_unset' value for 'configbytes'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 12:53:51 +0200] rev 32980
config: use the new '_unset' value for 'configbytes' This should let 'configbytes' delegates all special processing of the default config value to the main 'config' method.
Sat, 17 Jun 2017 12:53:40 +0200 config: use the new '_unset' value for 'configint'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 12:53:40 +0200] rev 32979
config: use the new '_unset' value for 'configint' This should let 'configint' delegates all special processing of the default config value to the main 'config' method.
Sat, 17 Jun 2017 12:52:31 +0200 config: use the new '_unset' value for 'configwith'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 12:52:31 +0200] rev 32978
config: use the new '_unset' value for 'configwith' This should let 'configwith' delegate all special processing of the default config value to the main 'config' method. This changeset introduce a small change in behavior since the default value is run through the 'convert' function. This does not seems harmful and no actual test break. This small change make the code simpler so I'm keeping it.
Sat, 17 Jun 2017 12:52:16 +0200 config: use the new '_unset' value for 'configbool'
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 12:52:16 +0200] rev 32977
config: use the new '_unset' value for 'configbool' This should let 'configbool' delegate all special processing of the default config value to the main 'config' method. The default value for bool (False) is still enforced in this method if no other default were passed.
Sat, 17 Jun 2017 12:51:11 +0200 config: explicitly track the use of the standard default value
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 17 Jun 2017 12:51:11 +0200] rev 32976
config: explicitly track the use of the standard default value We introduce a small object used to detect that no specific default value has been passed to 'ui.config'. We need this explicit special value since "None" is a valid and common default value. The end goal here is to make progress on a centralised and explicit declaration of the available config option. A first good usecase for this are "default" value. Before starting looking further down this alley we needs to rework the handling of default value in the 'ui' object to have all configxyz methods going through the same logic. This is the first changeset on this trek.
Mon, 19 Jun 2017 22:14:37 -0700 clonebundle: update hook arguments (BC)
Martin von Zweigbergk <martinvonz@google.com> [Mon, 19 Jun 2017 22:14:37 -0700] rev 32975
clonebundle: update hook arguments (BC) By calling applybundle() with 'clonebundles' and the url instead of calling processbundle(), the hooks will get different arguments: HG_SOURCE will be 'clonebundles' instead of 'bundle2' and HG_URL will be the url instead of 'bundle2'. This is consistent with the bundle1 behavior and seems like a bug fix, but I'm marking it BC anyway.
Sat, 10 Jun 2017 23:42:38 -0700 commands: move checkconflict to bookmarks module
Sean Farley <sean@farley.io> [Sat, 10 Jun 2017 23:42:38 -0700] rev 32974
commands: move checkconflict to bookmarks module Again, commands.bookmark is getting too large. checkconflict already has a lot of state and putting it in the bmstore makes more sense than having it as a closure. This also allows extensions a place to override this behavior. While we're here, add a documentation string because, well, we should be documenting more of our methods.
Sat, 10 Jun 2017 23:32:58 -0700 commands: move checkformat to bookmarks module
Sean Farley <sean@farley.io> [Sat, 10 Jun 2017 23:32:58 -0700] rev 32973
commands: move checkformat to bookmarks module commands.bookmark has grown quite large with two closures already. Let's split this up (and in the process allow extensions to override the default behavior).
Tue, 20 Jun 2017 14:35:53 -0700 tests: tell pip not to check for a newer version
Danek Duvall <danek.duvall@oracle.com> [Tue, 20 Jun 2017 14:35:53 -0700] rev 32972
tests: tell pip not to check for a newer version pip will check to see if it's the latest version, and complain if it isn't. The --no-index flag implies the --disable-pip-version-check flag, and makes the warning (and any associated network activity) go away.
Sat, 22 Apr 2017 21:16:08 +0900 changeset_templater: backport parts map of [templates] section from formatter
Yuya Nishihara <yuya@tcha.org> [Sat, 22 Apr 2017 21:16:08 +0900] rev 32971
changeset_templater: backport parts map of [templates] section from formatter
Sat, 22 Apr 2017 21:29:00 +0900 formatter: add support for parts map of [templates] section
Yuya Nishihara <yuya@tcha.org> [Sat, 22 Apr 2017 21:29:00 +0900] rev 32970
formatter: add support for parts map of [templates] section Unlike a mapfile whose template is looked up by spec -> mapfile -> topic, [templates] section is global. We use :sub-section syntax to define parts per template.
Sat, 17 Jun 2017 16:32:20 +0900 changeset_templater: backport separator template from formatter
Yuya Nishihara <yuya@tcha.org> [Sat, 17 Jun 2017 16:32:20 +0900] rev 32969
changeset_templater: backport separator template from formatter As commented, this should be used with docheader and docfooter, not with header nor footer. That's one reason why no props are passed to templater when rendering a separator. (See map-cmdline.changelog to understand what the "header" is.)
Sat, 22 Apr 2017 21:50:51 +0900 formatter: add support for separator template
Yuya Nishihara <yuya@tcha.org> [Sat, 22 Apr 2017 21:50:51 +0900] rev 32968
formatter: add support for separator template This seems useful for writing JSON template.
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 +10000 tip