Mon, 11 Sep 2017 13:03:27 -0700 context: add overlayworkingcontext and overlayworkingfilectx
Phil Cohen <phillco@fb.com> [Mon, 11 Sep 2017 13:03:27 -0700] rev 34119
context: add overlayworkingcontext and overlayworkingfilectx These two classes will be used extensively in the first in-memory merge milestone. Differential Revision: https://phab.mercurial-scm.org/D616
Sun, 10 Sep 2017 18:52:40 -0700 changegroup: rename getsubsetraw to makestream
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:52:40 -0700] rev 34118
changegroup: rename getsubsetraw to makestream Now that nothing uses getsubsetraw except makestream, let's move the functionality into the makestream. This removes the last remaining excess changegroup creation function, getsubsetraw. Differential Revision: https://phab.mercurial-scm.org/D671
Sun, 10 Sep 2017 18:51:31 -0700 changegroup: remove external uses of getbundler
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:51:31 -0700] rev 34117
changegroup: remove external uses of getbundler Now that makestream and makechangegroup are the primary creation methods for changegroups, let's get rid of this rogue use of getbundler and getsubsetraw. Differential Revision: https://phab.mercurial-scm.org/D670
Sun, 10 Sep 2017 18:50:12 -0700 changegroup: replace getchangegroup with makechangegroup
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:50:12 -0700] rev 34116
changegroup: replace getchangegroup with makechangegroup As part of reducing the number of changegroup creation APIs, let's replace getchangegroup with calls to makechangegroup. This is mostly a drop in replacement, but it does change the version specifier to be required, so it's more obvious which callers are creating old version 1 changegroups still. Differential Revision: https://phab.mercurial-scm.org/D669
Sun, 10 Sep 2017 18:48:42 -0700 changegroup: replace changegroup with makechangegroup
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:48:42 -0700] rev 34115
changegroup: replace changegroup with makechangegroup As part of reducing the number of changegroup creation APIs, let's replace the changegroup function with makechangegroup. This pushes the responsibility of creating the outgoing set to the caller, but that seems like a simple and reasonable concept for the caller to be aware of. Differential Revision: https://phab.mercurial-scm.org/D668
Sun, 10 Sep 2017 18:47:39 -0700 changegroup: delete getlocalchangegroup
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:47:39 -0700] rev 34114
changegroup: delete getlocalchangegroup As part of reducing the number of changegroup creation APIs, let's go ahead and delete this unused function. It appears to have been deprecated in the last release anyway. Differential Revision: https://phab.mercurial-scm.org/D667
Sun, 10 Sep 2017 19:01:56 -0700 changegroup: replace getlocalchangegroupraw with makestream
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 19:01:56 -0700] rev 34113
changegroup: replace getlocalchangegroupraw with makestream As part of reducing the number of changegroup creation apis, let's replace calls to getlocalchangegroupraw with calls to makestream. Aside from one case of checking if there are no outgoing commits and returning None, this is pretty much a drop in replacement. Differential Revision: https://phab.mercurial-scm.org/D666
Sun, 10 Sep 2017 18:43:59 -0700 changegroup: replace changegroupsubset with makechangegroup
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:43:59 -0700] rev 34112
changegroup: replace changegroupsubset with makechangegroup As part of getting rid of all the permutations of changegroup creation, let's remove changegroupsubset and call makechangegroup instead. This moves the responsibility of creating the outgoing set to the caller, but that seems like a relatively reasonable unit of functionality for the caller to have to care about (i.e. what commits should be bundled). Differential Revision: https://phab.mercurial-scm.org/D665
Sun, 10 Sep 2017 18:39:02 -0700 changegroup: replace getsubset with makechangegroup
Durham Goode <durham@fb.com> [Sun, 10 Sep 2017 18:39:02 -0700] rev 34111
changegroup: replace getsubset with makechangegroup The current changegroup APIs are a bit of a mess. Currently you can use getsubsetraw, getsubset, changegroupsubset, getlocalchangegroupraw, getchangegroup, and getlocalchangroup to produce changegroups. This patch is the beginning of a refactor to boil all of that away to just makechangegroup and makestream. The first step adds the new functions and replaces getsubset function with them. Differential Revision: https://phab.mercurial-scm.org/D664
Wed, 06 Sep 2017 16:17:04 -0700 rebase: remove unnecessary '.unfiltered()' calls
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 16:17:04 -0700] rev 34110
rebase: remove unnecessary '.unfiltered()' calls Now we have a clear centric place to control whether `rbsrt.repo` is unfiltered or not, we can drop `unfiltered()` in other places. Differential Revision: https://phab.mercurial-scm.org/D645
Wed, 06 Sep 2017 16:13:04 -0700 rebase: remove complex unhiding code
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 16:13:04 -0700] rev 34109
rebase: remove complex unhiding code This is similar to Martin von Zweigbergk's previous patch [1]. Previous patches are adding more `.unfiltered()` to the rebase code. So I wonder: are we playing whack-a-mole regarding on `unfiltered()` in rebase? Thinking about it, I believe most of the rebase code *should* just use an unfiltered repo. The only exception is before we figuring out a `rebasestate`. This patch makes it so. See added comment in code for why that's more reasonable. This would make the code base cleaner (not mangling the `repo` object), faster (no need to invalidate caches), simpler (less LOC), less error-prone (no need to think about what to unhide, ex. should we unhide wdir p2? how about destinations?), and future proof (other code may change visibility in an unexpected way, ex. directaccess may make the destination only visible when it's in "--dest" revset tree). [1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-March/094277.html Differential Revision: https://phab.mercurial-scm.org/D644
Wed, 06 Sep 2017 15:23:19 -0700 rebase: use unfiltered repo when loading state
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 15:23:19 -0700] rev 34108
rebase: use unfiltered repo when loading state Before this patch, `rebase --abort` may fail to do the cleanup: $ hg rebase --abort rebase aborted (no revision is removed, only broken state is cleared) The added test case makes sure `--abort` works in this case. Differential Revision: https://phab.mercurial-scm.org/D643
Wed, 06 Sep 2017 12:40:00 -0700 rebase: do not crash rebasing merge with a parent having hidden successor
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 12:40:00 -0700] rev 34107
rebase: do not crash rebasing merge with a parent having hidden successor The added test will crash with previous code. Differential Revision: https://phab.mercurial-scm.org/D640
Wed, 06 Sep 2017 18:33:55 -0700 changegroup: fix to allow empty manifest parts
Durham Goode <durham@fb.com> [Wed, 06 Sep 2017 18:33:55 -0700] rev 34106
changegroup: fix to allow empty manifest parts The current chunk reading algorithm relied on counting the number of empty chunks and comparing it to the number of chunk lists it expected (1 list of files for cg1 and cg2, and 1 list of files + 1 list of trees for cg3). This implicitly assumed that both the changelog part and the manifestlog part were never empty (since them being empty would cause it to count it as one list being done, and screw up the count). In our treemanifest code, the manifest section could be empty, so we need to handle that case. This patches refactors that code to be more explicit about how it counts the expected parts. Differential Revision: https://phab.mercurial-scm.org/D646
Tue, 05 Sep 2017 15:18:45 -0700 wrapcommand: use functools.partial
Jun Wu <quark@fb.com> [Tue, 05 Sep 2017 15:18:45 -0700] rev 34105
wrapcommand: use functools.partial Like the previous patch, this helps remove noises in traceback. Practically, this removes another 6 lines in `rebase -s . -d .` traceback in my setup: .... File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) -File "hg/mercurial/extensions.py", line 331, in closure - return func(*(args + a), **kw) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) File "fb-hgext/hgext3rd/fbhistedit.py", line 283, in _rebase return orig(ui, repo, **opts) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) -File "hg/mercurial/extensions.py", line 331, in closure - return func(*(args + a), **kw) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) File "remotenames.py", line 633, in exrebasecmd ret = orig(ui, repo, **opts) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) -File "hg/mercurial/extensions.py", line 331, in closure - return func(*(args + a), **kw) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) File "fb-hgext/hgext3rd/fbamend/__init__.py", line 453, in wraprebase return orig(ui, repo, **opts) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) .... Differential Revision: https://phab.mercurial-scm.org/D633
Tue, 05 Sep 2017 13:37:36 -0700 wrapfunction: use functools.partial if possible
Jun Wu <quark@fb.com> [Tue, 05 Sep 2017 13:37:36 -0700] rev 34104
wrapfunction: use functools.partial if possible Every `extensions.bind` call inserts a frame in traceback: ... in closure return func(*(args + a), **kw) which makes traceback noisy. The Python stdlib has a `functools.partial` which is backed by C code and does not pollute traceback. However it does not support instancemethod and sets `args` attribute which could be problematic for alias handling. This patch makes `wrapfunction` use `functools.partial` if we are wrapping a function directly exported by a module (so it's impossible to be a class or instance method), and special handles `wrapfunction` results so alias handling code could handle `args` just fine. As an example, `hg rebase -s . -d . --traceback` got 6 lines removed in my setup: File "hg/mercurial/dispatch.py", line 898, in _dispatch cmdpats, cmdoptions) -File "hg/mercurial/extensions.py", line 333, in closure - return func(*(args + a), **kw) File "hg/hgext/journal.py", line 84, in runcommand return orig(lui, repo, cmd, fullargs, *args) -File "hg/mercurial/extensions.py", line 333, in closure - return func(*(args + a), **kw) File "fb-hgext/hgext3rd/fbamend/hiddenoverride.py", line 119, in runcommand result = orig(lui, repo, cmd, fullargs, *args) File "hg/mercurial/dispatch.py", line 660, in runcommand ret = _runcommand(ui, options, cmd, d) -File "hg/mercurial/extensions.py", line 333, in closure - return func(*(args + a), **kw) File "hg/hgext/pager.py", line 69, in pagecmd return orig(ui, options, cmd, cmdfunc) .... Differential Revision: https://phab.mercurial-scm.org/D632
Fri, 01 Sep 2017 12:34:36 -0700 cmdutil: remove redundant commitfunc parameter in amend (API)
Saurabh Singh <singhsrb@fb.com> [Fri, 01 Sep 2017 12:34:36 -0700] rev 34103
cmdutil: remove redundant commitfunc parameter in amend (API) Since the redundant commit during the amend has been been removed, there is no need for commit callback function in amend now. Therefore, this commit removes the unused parameter "commmitfunc" which was being used for this purpose. Test Plan: Ensured that all the tests pass Differential Revision: https://phab.mercurial-scm.org/D635
Fri, 01 Sep 2017 12:34:36 -0700 cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com> [Fri, 01 Sep 2017 12:34:36 -0700] rev 34102
cmdutil: remove the redundant commit during amend There was an extra commit made during the amend operation to track the changes to the working copy. However, this logic was written a long time back and newer API's make this extra commit redundant. Therefore, I am removing the extra commit. After this change, I noticed that - Execution time of the cmdutil.amend improved by over 40%. - Execution time of "hg commit --amend" improved by over 20%. Test Plan: I ensured that the all the hg tests passed after the change. I had to fix a few tests which were aware of the extra commit made during the amend. Differential Revision: https://phab.mercurial-scm.org/D636
Wed, 06 Sep 2017 12:56:19 -0700 checknlink: rename file object from 'fd' to 'fp'
Jun Wu <quark@fb.com> [Wed, 06 Sep 2017 12:56:19 -0700] rev 34101
checknlink: rename file object from 'fd' to 'fp' Make it clear that `fp` (`file` object) is different from `fd` (low-level file descriptor number). Differential Revision: https://phab.mercurial-scm.org/D642
Tue, 05 Sep 2017 15:06:45 -0700 cleanup: rename "matchfn" to "match" where obviously a matcher
Martin von Zweigbergk <martinvonz@google.com> [Tue, 05 Sep 2017 15:06:45 -0700] rev 34100
cleanup: rename "matchfn" to "match" where obviously a matcher We usually call matchers either "match" or "m" and reserve "matchfn" for functions. Differential Revision: https://phab.mercurial-scm.org/D641
Wed, 06 Sep 2017 08:22:54 -0700 check-code: fix incorrect capitalization in camelcase regex
Martin von Zweigbergk <martinvonz@google.com> [Wed, 06 Sep 2017 08:22:54 -0700] rev 34099
check-code: fix incorrect capitalization in camelcase regex This was found internally at Google as part of a monorepo-wide cleanup. Differential Revision: https://phab.mercurial-scm.org/D637
Wed, 06 Sep 2017 10:41:13 -0700 amend: use context manager for config override
Martin von Zweigbergk <martinvonz@google.com> [Wed, 06 Sep 2017 10:41:13 -0700] rev 34098
amend: use context manager for config override Differential Revision: https://phab.mercurial-scm.org/D639
Wed, 06 Sep 2017 10:42:02 -0700 amend: delete dead assignment to "newid"
Martin von Zweigbergk <martinvonz@google.com> [Wed, 06 Sep 2017 10:42:02 -0700] rev 34097
amend: delete dead assignment to "newid" Differential Revision: https://phab.mercurial-scm.org/D638
Fri, 01 Sep 2017 17:09:53 -0700 checknlink: use a random temp file name for checking
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 17:09:53 -0700] rev 34096
checknlink: use a random temp file name for checking Previously, if `.hg/store/00manifest.d.hgtmp1` exists, hg will copy the entire `00manifest.d` every time when appending new manifest revisions. That could happen if Mercurial or the machine crashed when `.hgtmp1` was just created but not deleted yet. This patch changes the fixed name to a random generated name. To be consistent with D468, `~` suffix was used. Differential Revision: https://phab.mercurial-scm.org/D611
Sun, 03 Sep 2017 02:34:01 +0530 copytrace: move the default copytracing algorithm in a new function
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 03 Sep 2017 02:34:01 +0530] rev 34095
copytrace: move the default copytracing algorithm in a new function We are going to introduce a new fast heuristic based copytracing algorithm, so lets make mergecopies the function which decides which algorithm to go with and then calls the related function. While I was here, I add a line in test-copy-move-merge.t saying its a test related to the full copytracing algorithm. Differential Revision: https://phab.mercurial-scm.org/D622
Sun, 03 Sep 2017 01:52:19 +0530 copytrace: replace experimental.disablecopytrace config with copytrace (BC)
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 03 Sep 2017 01:52:19 +0530] rev 34094
copytrace: replace experimental.disablecopytrace config with copytrace (BC) This patch replaces experimental.disablecopytrace with experimental.copytrace. Since the words does not means the same, the default value is also changed. Now experimental.copytrace defaults to 'on'. The new value is not boolean value as we will be now having two different algorithms (current one and heuristics one to be imported from fbext) so we need this to be have more options than booleans. The old config option is not kept is completely replaced as that was under experimental and we don't gurantee BC to experimental things. .. bc:: The config option for copytrace `experimental.disablecopytrace` is now replaced with `experimental.copytrace` which defaults to `on`. If you need to turn off copytracing, add `[experimental] copytrace = off` to your config. Differential Revision: https://phab.mercurial-scm.org/D621
Tue, 05 Sep 2017 12:04:02 -0700 filemerge: use fctx.write() in the internal:dump tool, instead of copy
Phil Cohen <phillco@fb.com> [Tue, 05 Sep 2017 12:04:02 -0700] rev 34093
filemerge: use fctx.write() in the internal:dump tool, instead of copy This is slower but allows this tool to work with the "deferred writes" milestone of in-memory merge. The performance hit is not too noticiable since this only used for the :dump merge tool during a conflict. Differential Revision: https://phab.mercurial-scm.org/D617
Thu, 31 Aug 2017 22:39:10 -0700 largefiles: remove unused assignments from wrapfunction()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 31 Aug 2017 22:39:10 -0700] rev 34092
largefiles: remove unused assignments from wrapfunction() The return values from wrapfunction() were never used here. Using the value is also a little tricky and wrappedfunction() should be preferred, so let's just delete the assignments. There's also a bunch of return values from wrapcommand() being assigned to a variable here, but at least that value can be (and is used after some of the assignments). Differential Revision: https://phab.mercurial-scm.org/D618
Thu, 31 Aug 2017 18:24:08 +0300 branches: correctly show inactive multiheaded branches
the31k <the31k@thethirty.one> [Thu, 31 Aug 2017 18:24:08 +0300] rev 34091
branches: correctly show inactive multiheaded branches Issue being fixed here: `hg branches` incorrectly renders inactive multiheaded branches as active if they have closed heads. Example: ``` $ hg log --template '{rev}:{node|short} "{desc}" ({branch}) [parents: {parents}]\n' 4:2e2fa7af8357 "merge" (default) [parents: 0:c94e548c8c7d 3:7be622ae5832 ] 3:7be622ae5832 "2" (somebranch) [parents: 1:81c1d9458987 ] 2:be82cf30409c "close" (somebranch) [parents: ] 1:81c1d9458987 "1" (somebranch) [parents: ] 0:c94e548c8c7d "initial" (default) [parents: ] $ hg branches default 4:2e2fa7af8357 somebranch 3:7be622ae5832 ``` Branch `somebranch` have two heads, the 1st one being closed (rev 2) and the other one being merged into default (rev 3). This branch should be shown as inactive one. This happens because we intersect branch heads with repo heads to check branch activity. In this case intersection in a set with one node (rev 2). This head is closed but the branch is marked as active nevertheless. Fix is to check branch activity by intersecting only open heads set. Fixed output: ``` $ hg branches default 4:2e2fa7af8357 somebranch 3:7be622ae5832 (inactive) ``` Relevant tests for multihead branches added to test-branches suite. Implentation note about adding `iteropen` method: At first I have tried to modify `iterbranches` is such a way that it would filter out closed heads itself. For example it could have `closed=False` parameter. But in this case we would have to filter closed tips as well. Reasoning in terms of `hg branches` we actually are not allowed to do this. Also, we need to do heads filtering only if tip is not closed itself. But if it is - we are ok to skip filtering, because branch is already known to be inactive. So we can't implement heads filtering in `iterbranches` in elegant way, because we will end up with something like `closed_heads=False` or even `closed_heads_is_tip_is_open`. Finally I decided to move this logic to the `branches` function, adding `iteropen` helper method. Differential Revision: https://phab.mercurial-scm.org/D583
Sun, 03 Sep 2017 21:17:25 +0900 parser: stabilize output of prettyformat() by using byte-safe repr()
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 21:17:25 +0900] rev 34090
parser: stabilize output of prettyformat() by using byte-safe repr() The format of leaf nodes is slightly changed so they look more similar to internal nodes.
Sun, 03 Sep 2017 17:51:23 +0900 py3: fix repr(util.url) to return system string
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:51:23 +0900] rev 34089
py3: fix repr(util.url) to return system string This is required on Python 3.
Sun, 03 Sep 2017 17:37:17 +0900 py3: use bytes[n:n + 1] to get bytes in templater._parsetemplate()
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:37:17 +0900] rev 34088
py3: use bytes[n:n + 1] to get bytes in templater._parsetemplate()
Sun, 03 Sep 2017 17:14:53 +0900 py3: fix type of attribute name in smartset.py
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:14:53 +0900] rev 34087
py3: fix type of attribute name in smartset.py
Sun, 03 Sep 2017 17:03:23 +0900 py3: fix mixed bytes/unicode in revsetlang._aliassyminitletters
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 17:03:23 +0900] rev 34086
py3: fix mixed bytes/unicode in revsetlang._aliassyminitletters
Sun, 03 Sep 2017 15:01:23 +0900 py3: fix type of regex literals in subrepo.py
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 15:01:23 +0900] rev 34085
py3: fix type of regex literals in subrepo.py
Sun, 03 Sep 2017 16:19:20 +0900 py3: replace bytes[n] with bytes[n:n + 1] in patch.py where needed
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 16:19:20 +0900] rev 34084
py3: replace bytes[n] with bytes[n:n + 1] in patch.py where needed
Sun, 03 Sep 2017 16:12:15 +0900 py3: fix type of regex literals in patch.py
Yuya Nishihara <yuya@tcha.org> [Sun, 03 Sep 2017 16:12:15 +0900] rev 34083
py3: fix type of regex literals in patch.py
Mon, 28 Aug 2017 14:49:00 -0700 revset: optimize "draft() & ::x" pattern
Jun Wu <quark@fb.com> [Mon, 28 Aug 2017 14:49:00 -0700] rev 34082
revset: optimize "draft() & ::x" pattern The `draft() & ::x` type query could be common for selecting one or more draft feature branches being worked on. Before this patch, `::x` may travel through the changelog DAG for a long distance until it gets a smaller revision number than `min(draft())`. It could be very slow on long changelog with distant (in terms of revision numbers) drafts. This patch adds a fast path for this situation, and will stop traveling the changelog DAG once `::x` hits a non-draft revision. The fast path also works for `secret()` and `not public()`. To measure the performance difference, I used drawdag to create a repo that emulates distant drafts: DRAFT4 | DRAFT3 # draft / PUBLIC9999 # public | PUBLIC9998 | . DRAFT2 . | . DRAFT1 # draft | / PUBLIC0001 # public And measured the performance using the repo: (BEFORE) $ hg perfrevset 'draft() & ::(DRAFT2+DRAFT4)' ! wall 0.017132 comb 0.010000 user 0.010000 sys 0.000000 (best of 156) $ hg perfrevset 'draft() & ::(all())' ! wall 0.024221 comb 0.030000 user 0.030000 sys 0.000000 (best of 113) (AFTER) $ hg perfrevset 'draft() & ::(DRAFT2+DRAFT4)' ! wall 0.000243 comb 0.000000 user 0.000000 sys 0.000000 (best of 9303) $ hg perfrevset 'draft() & ::(all())' ! wall 0.004319 comb 0.000000 user 0.000000 sys 0.000000 (best of 655) Differential Revision: https://phab.mercurial-scm.org/D441
Fri, 01 Sep 2017 12:13:17 -0700 phabricator: add a config to use curl for communication
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 12:13:17 -0700] rev 34081
phabricator: add a config to use curl for communication Not sure why, but I got `phabsend` hang on work network pretty frequently. The traceback indicates it hangs at `_sslobj.do_handshake()`: File "mercurial/sslutil.py", line 404, in wrapsocket sslsocket = sslcontext.wrap_socket(sock, server_hostname=serverhostname) File "/usr/lib/python2.7/ssl.py", line 363, in wrap_socket _context=self) File "/usr/lib/python2.7/ssl.py", line 611, in __init__ self.do_handshake() File "/usr/lib/python2.7/ssl.py", line 840, in do_handshake self._sslobj.do_handshake() I had tried adding `timeout` in various places but they seem not effective. It seems easier to just allow shelling out to `curl` with retry and timeout flags. This could also be helpful for people with an older Python installed without modern security (SNI). Differential Revision: https://phab.mercurial-scm.org/D605
Thu, 24 Aug 2017 18:00:23 -0700 phabricator: standardize colors
Jun Wu <quark@fb.com> [Thu, 24 Aug 2017 18:00:23 -0700] rev 34080
phabricator: standardize colors Previously, the `--confirm` text could have colors but the main `phabsend` does not. This patch adjusts the main command so it also has colors. A default color table was added so the colors are visible by default. Differential Revision: https://phab.mercurial-scm.org/D515
Fri, 01 Sep 2017 14:00:13 -0700 wireproto: do not abort after successful lookup
Kyle Lippincott <spectral@google.com> [Fri, 01 Sep 2017 14:00:13 -0700] rev 34079
wireproto: do not abort after successful lookup As far as I can tell, this interface originally used 'return' here, so the "fallthrough" to self._abort made sense. When it was switched to 'yield' this didn't make sense, but doesn't impact most uses because the 'plain' wrapper in peer.py's 'batchable' decorator only attempts to yield two items (args and value). When using iterbatch, however, it attempts to verify that the @batchable generators only emit 2 results, by expecting a StopIteration when attempting to access a third. Differential Revision: https://phab.mercurial-scm.org/D608
Fri, 01 Sep 2017 16:44:30 -0700 check-code: forbid "\S" in egrep regular expression
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 16:44:30 -0700] rev 34078
check-code: forbid "\S" in egrep regular expression BSD `egrep` does not like it. So let's forbid it. Differential Revision: https://phab.mercurial-scm.org/D610
Fri, 01 Sep 2017 15:47:32 -0700 check-code: forbid using bash in shebang
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 15:47:32 -0700] rev 34077
check-code: forbid using bash in shebang Some platforms (ex. FreeBSD) do not have `bash` by default. Therefore it should not be used in test scripts. Differential Revision: https://phab.mercurial-scm.org/D609
Fri, 01 Sep 2017 12:34:34 -0700 amend: add tests for amending only some files from commit to be amended
Saurabh Singh <singhsrb@fb.com> [Fri, 01 Sep 2017 12:34:34 -0700] rev 34076
amend: add tests for amending only some files from commit to be amended We do not have robust enough tests for scenarios where only some files in a changeset are amended. This presents an interesting scenario because the working copy could have modified versions of the remaining files in the pre-amend changeset. Therefore, I have added some tests to ensure that amend behaves as expected in these scenarios. Test Plan: Ensured that the test "test-commit-amend.t" passes. Differential Revision: https://phab.mercurial-scm.org/D596
Sat, 02 Sep 2017 21:49:45 +0900 test-editor-filename: fix portability of fake editor command
Yuya Nishihara <yuya@tcha.org> [Sat, 02 Sep 2017 21:49:45 +0900] rev 34075
test-editor-filename: fix portability of fake editor command - /bin/bash doesn't exist on FreeBSD - edit is executed by cmd.exe on Windows
Fri, 01 Sep 2017 12:34:36 -0700 amend: moving first assignment of newid closer to its use
Saurabh Singh <singhsrb@fb.com> [Fri, 01 Sep 2017 12:34:36 -0700] rev 34074
amend: moving first assignment of newid closer to its use newid was needlessly further away from where its intended to be used leading to bad readability. This commit moves it to address the same. The end goal is to remove the redundant commit in the amend code path and this commit takes care of cleaning up some unrelated code before that change. Test Plan: ran the test suite Differential Revision: https://phab.mercurial-scm.org/D597
Thu, 31 Aug 2017 18:35:39 -0700 amend: rectify comment
Saurabh Singh <singhsrb@fb.com> [Thu, 31 Aug 2017 18:35:39 -0700] rev 34073
amend: rectify comment Comment was ambiguous as there can be two parents of a changeset in mercurial. This commit fixes the comment to clarify that the first parent is being considered. Test Plan: ran the test suite Differential Revision: https://phab.mercurial-scm.org/D595
Fri, 01 Sep 2017 15:08:54 -0700 amend: removing redundant if condition
Saurabh Singh <singhsrb@fb.com> [Fri, 01 Sep 2017 15:08:54 -0700] rev 34072
amend: removing redundant if condition There is needless checking for the new commit hash not being equal to the old commit hash. This condition will always be true at this point in the code path and thus, can be removed safely. This commit removes the redundant condition. Test Plan: ran the test suite. Differential Revision: https://phab.mercurial-scm.org/D594
Fri, 01 Sep 2017 20:28:26 +0000 editor: file created for diff action should have .diff suffix
Michael Bolin <mbolin@fb.com> [Fri, 01 Sep 2017 20:28:26 +0000] rev 34071
editor: file created for diff action should have .diff suffix This is a follow-up to https://phab.mercurial-scm.org/D464 (6e6452bc441d) that introduced the new file extension behavior. It erroneously changed `.diff` to `.diff.hg.txt`. Test Plan: Verified `make tests` passes, particularly `test-editor-filename.t`. Differential Revision: https://phab.mercurial-scm.org/D607
Fri, 01 Sep 2017 11:13:55 -0700 test-amend: match output using conditional test case name
Jun Wu <quark@fb.com> [Fri, 01 Sep 2017 11:13:55 -0700] rev 34070
test-amend: match output using conditional test case name D466 (6cc8f848b4c3) allows output to be conditionally matched by test name. This patch changes test-amend.t to use that feature, instead of duplicating `hg amend` command or use `-q` to silence its output. Differential Revision: https://phab.mercurial-scm.org/D601
Thu, 31 Aug 2017 19:40:15 -0700 util: use set for reserved Windows filenames
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 31 Aug 2017 19:40:15 -0700] rev 34069
util: use set for reserved Windows filenames Previously, we were performing membership testing against a list. Change it to a set for a minor perf win. While we're at it, explode the assignment in place so less work is needed at module import time. Differential Revision: https://phab.mercurial-scm.org/D600
Fri, 01 Sep 2017 11:52:20 -0700 context: add arbitraryfilectx, which can represent files outside the workdir
Phil Cohen <phillco@fb.com> [Fri, 01 Sep 2017 11:52:20 -0700] rev 34068
context: add arbitraryfilectx, which can represent files outside the workdir Move it from contrib/simplemerge so it can be re-used in the future. Differential Revision: https://phab.mercurial-scm.org/D604
Fri, 01 Sep 2017 10:35:43 -0700 simplemerge: remove unused `filtereddata` parameter
Phil Cohen <phillco@fb.com> [Fri, 01 Sep 2017 10:35:43 -0700] rev 34067
simplemerge: remove unused `filtereddata` parameter Differential Revision: https://phab.mercurial-scm.org/D603
Fri, 01 Sep 2017 10:35:43 -0700 simplemerge: remove unused `repo` parameter
Phil Cohen <phillco@fb.com> [Fri, 01 Sep 2017 10:35:43 -0700] rev 34066
simplemerge: remove unused `repo` parameter This is now no longer used or needed thanks to the `decodeddata()` context function. Differential Revision: https://phab.mercurial-scm.org/D602
Tue, 29 Aug 2017 18:24:51 +0200 extensions: prohibit unicode defaults
Christophe de Vienne <christophe@cdevienne.info> [Tue, 29 Aug 2017 18:24:51 +0200] rev 34065
extensions: prohibit unicode defaults If the default value of an option is a unicode string (something than happen easily when using a 'from __future__ import unicode_literals'), any value passed on the command line will be ignored because the fancyopts module only checks for byte strings and not unicode strings. Changing fancyopts behavior is easy but would make assumptions on how the python3 port should be done, which is outside the scope of this patch. The chosen approach is to stop an extension from being loaded when a unicode default value is detected, with a hint for the developer.
Sat, 19 Aug 2017 22:04:03 +0900 revsetlang: remove unused functions
Yuya Nishihara <yuya@tcha.org> [Sat, 19 Aug 2017 22:04:03 +0900] rev 34064
revsetlang: remove unused functions Superseded by the _match() function.
Wed, 17 Feb 2016 21:40:59 +0900 revsetlang: match tree by helper function on optimize
Yuya Nishihara <yuya@tcha.org> [Wed, 17 Feb 2016 21:40:59 +0900] rev 34063
revsetlang: match tree by helper function on optimize This should make optimize() more readable and less error-prone, but it doubles the parsing cost. (original) $ python -m timeit -n10000 -s 'from mercurial import revsetlang as L' \ 'L.optimize(L.analyze(L.parse("ancestors(x) and not ancestors(y)")))' 10000 loops, best of 3: 79.3 usec per loop (this patch) $ python -m timeit -n10000 -s 'from mercurial import revsetlang as L' \ 'L._treecache.clear(); \ L.optimize(L.analyze(L.parse("ancestors(x) and not ancestors(y)")))' 10000 loops, best of 3: 201 usec per loop
Wed, 17 Feb 2016 21:31:09 +0900 parser: add helper function to test if pattern matches parsed tree
Yuya Nishihara <yuya@tcha.org> [Wed, 17 Feb 2016 21:31:09 +0900] rev 34062
parser: add helper function to test if pattern matches parsed tree This function will be used as follows: match('ancestors(_) and not ancestors(_)', x) See the next patch for details.
Wed, 17 Feb 2016 21:38:25 +0900 revsetlang: build optimized tree by helper function
Yuya Nishihara <yuya@tcha.org> [Wed, 17 Feb 2016 21:38:25 +0900] rev 34061
revsetlang: build optimized tree by helper function This should make optimize() more readable, but it doubles the parsing cost. (original) $ python -m timeit -n10000 -s 'from mercurial import revsetlang as L' \ 'L.optimize(L.analyze(L.parse("::tip")))' 10000 loops, best of 3: 18.1 usec per loop (this patch) $ python -m timeit -n10000 -s 'from mercurial import revsetlang as L' \ 'L._treecache.clear(); L.optimize(L.analyze(L.parse("::tip")))' 10000 loops, best of 3: 48.4 usec per loop 30usec isn't dominant compared to the revset evaluation, but that is a cost. That's why a parsed tree is cached, which can benefit in hgweb or chg server.
Wed, 17 Feb 2016 21:30:04 +0900 parser: add helper function that constructs parsed tree from template
Yuya Nishihara <yuya@tcha.org> [Wed, 17 Feb 2016 21:30:04 +0900] rev 34060
parser: add helper function that constructs parsed tree from template This function will be used as follows: build('only(_, _)', x, y) See the next patch for details.
Wed, 30 Aug 2017 18:19:14 +0530 patch: take messages out of the function so that extensions can add entries
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 30 Aug 2017 18:19:14 +0530] rev 34059
patch: take messages out of the function so that extensions can add entries Extensions will want to have interactive thing for more operations or particulary want to show more verbs. So this patch takes out the message thing from the function so that extensions can add verbs to this. The curses one is also not in any function so extensions can add more actions and verbs there. Differential Revision: https://phab.mercurial-scm.org/D567
Wed, 02 Aug 2017 21:24:29 -0700 run-tests: allow bisecting a different repo
Jun Wu <quark@fb.com> [Wed, 02 Aug 2017 21:24:29 -0700] rev 34058
run-tests: allow bisecting a different repo Add `--bisect-repo` flag which accepts a different repo to bisect. 3rd party extensions may reuse `run-tests.py` from core to run tests. Test failure could be caused by either a core hg change or the 3rd party extension code itself. Having a way to specify which repo to bisect is useful. Differential Revision: https://phab.mercurial-scm.org/D578
Wed, 02 Aug 2017 21:01:38 -0700 run-tests: extract prefix of bisect commands to a variable
Jun Wu <quark@fb.com> [Wed, 02 Aug 2017 21:01:38 -0700] rev 34057
run-tests: extract prefix of bisect commands to a variable This does not change any logic. Differential Revision: https://phab.mercurial-scm.org/D577
Wed, 02 Aug 2017 21:01:38 -0700 run-tests: pass --with-hg to run-tests.py command used by bisect
Jun Wu <quark@fb.com> [Wed, 02 Aug 2017 21:01:38 -0700] rev 34056
run-tests: pass --with-hg to run-tests.py command used by bisect This makes `run-tests.py -l test-run-tests.t` 23 seconds faster on my laptop. Inside the test, `$ rt --known-good-rev=0 test-bisect.t` took 24.9 seconds before, and 1.2 seconds after. Differential Revision: https://phab.mercurial-scm.org/D576
Mon, 28 Aug 2017 13:43:25 -0700 import-checker: allow relative import a module being checked
Jun Wu <quark@fb.com> [Mon, 28 Aug 2017 13:43:25 -0700] rev 34055
import-checker: allow relative import a module being checked This would make the checker more friendly for 3rd-party code. For example, In remotefilelog/x.py, it may have: from . import shallowutils That could trigger "relative import of stdlib module" if "remotefilelog" was installed in the system. If the module being checked conflicts with the system module, it makes sense to not treat that module as system module. This patch makes it so. Differential Revision: https://phab.mercurial-scm.org/D552
Thu, 31 Aug 2017 11:28:59 -0700 merge: move some of the logic in batchget() to workingfilectx
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34054
merge: move some of the logic in batchget() to workingfilectx We will use this logic in two places with in-memory merge. Differential Revision: https://phab.mercurial-scm.org/D444
Thu, 31 Aug 2017 11:28:59 -0700 filemerge: add _restorebackup
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34053
filemerge: add _restorebackup Differential Revision: https://phab.mercurial-scm.org/D404
Thu, 31 Aug 2017 11:28:59 -0700 filemerge: reduce creation of tempfiles until needed
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34052
filemerge: reduce creation of tempfiles until needed This restricts the creation of temporary files to just `_xmerge`, when we call an external tool. Differential Revision: https://phab.mercurial-scm.org/D403
Thu, 31 Aug 2017 11:28:59 -0700 filemerge: add `_workingpath`
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34051
filemerge: add `_workingpath` This reduces any reliance on `a`. Differential Revision: https://phab.mercurial-scm.org/D401
Thu, 31 Aug 2017 11:28:59 -0700 filemerge: move a util copy call to filectx.write
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34050
filemerge: move a util copy call to filectx.write This way a future in-memory-merge context can intercept them. Differential Revision: https://phab.mercurial-scm.org/D400
Thu, 31 Aug 2017 11:28:59 -0700 filemerge: eliminate most uses of tempfiles
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:28:59 -0700] rev 34049
filemerge: eliminate most uses of tempfiles Emphasize that they're unused so we can more easily remove them later. Differential Revision: https://phab.mercurial-scm.org/D399
Thu, 31 Aug 2017 11:05:19 -0700 filemerge: extract _maketemp and _makebackup
Phil Cohen <phillco@fb.com> [Thu, 31 Aug 2017 11:05:19 -0700] rev 34048
filemerge: extract _maketemp and _makebackup These functions will be modified by in-memory merge, so let's extract them first and add some comments. This also shortens `_filemerge` a bit. Differential Revision: https://phab.mercurial-scm.org/D388
Thu, 31 Aug 2017 21:56:40 +0900 encoding: check overflow while calculating size of JSON escape buffer
Yuya Nishihara <yuya@tcha.org> [Thu, 31 Aug 2017 21:56:40 +0900] rev 34047
encoding: check overflow while calculating size of JSON escape buffer The minimum input size to exploit is ~682MB (= INT_MAX / len('\\u0000') * 2) on 32bit system, which isn't easy to achieve using Python str in 2GB process address space, but probably doable.
Wed, 30 Aug 2017 20:25:56 +0000 editor: use an unambiguous path suffix for editor files
Michael Bolin <mbolin@fb.com> [Wed, 30 Aug 2017 20:25:56 +0000] rev 34046
editor: use an unambiguous path suffix for editor files Changes the API of `ui.edit()` to take an optional `action` argument, which is used when constructing the suffix of the temp file. Previously, it was possible to set the suffix by specifying a `suffix` to the optional `extra` dict that was passed to `ui.edit()`, but the goal is to drop support for `extra.suffix` and make `action` a required argument. To this end, `ui.edit()` now yields a `develwarn()` if `action` is not set or if `extra.suffix` is set. I updated all calls to `ui.edit()` I could find in `hg-crew` to specify the appropriate `action`. This means that when creating a commit, instead of the path to the editor file being something like: `/tmp/hg-editor-XXXXXX.txt` it is now something like: `/tmp/hg-editor-XXXXXX.commit.hg.txt` Some editors (such as Atom) make it possible to statically define a [TextMate] grammar for files with a particular suffix. For example, because Git reliably uses `.git/COMMIT_EDITMSG` and `.git/MERGE_MSG` as the paths for commit-type messages, it is trivial to define a grammar that is applied when files of either name are opened in Atom: https://github.com/atom/language-git/blob/v0.19.1/grammars/git%20commit%20message.cson#L4-L5 Because Hg historically used a generic `.txt` suffix, it was much harder to disambiguate whether a file was an arbitrary text file as opposed to one created for the specific purpose of authoring an Hg commit message. This also makes it easier to add special support for `histedit`, as it has its own suffix that is distinct from a commit: `/tmp/hg-histedit-XXXXXX.histedit.hg.txt` Test Plan: Added an integration test: `test-editor-filename.t`. Manually tested: ran `hg ci --amend` for this change and saw that it used `/tmp/hg-editor-ZZjcz0.commit.hg.txt` as the path instead of `/tmp/hg-editor-ZZjcz0.txt` as the path. Verified `make tests` passes. Differential Revision: https://phab.mercurial-scm.org/D464
Wed, 30 Aug 2017 09:21:31 -0700 revlog: move check for wdir from changelog to revlog
Martin von Zweigbergk <martinvonz@google.com> [Wed, 30 Aug 2017 09:21:31 -0700] rev 34045
revlog: move check for wdir from changelog to revlog Yuya said he preferred this (to keep them in one place, I think). Differential Revision: https://phab.mercurial-scm.org/D569
Tue, 22 Aug 2017 21:21:43 -0400 revlog: use pycompat.bytestr() to reliably have a %s-able value
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 21:21:43 -0400] rev 34044
revlog: use pycompat.bytestr() to reliably have a %s-able value
Tue, 22 Aug 2017 23:11:35 -0400 debugcommands: stabilize output of debugbundle by having a custom repr
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 23:11:35 -0400] rev 34043
debugcommands: stabilize output of debugbundle by having a custom repr We handle all dict-like things the same, and don't worry about it actually being a repr.
Tue, 22 Aug 2017 20:25:08 -0400 python3: whitelist another 5 passing tests found with the ratchet script
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 20:25:08 -0400] rev 34042
python3: whitelist another 5 passing tests found with the ratchet script
Tue, 22 Aug 2017 20:06:58 -0400 python3: replace sorted(<dict>.iterkeys()) with sorted(<dict>)
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 20:06:58 -0400] rev 34041
python3: replace sorted(<dict>.iterkeys()) with sorted(<dict>)
Tue, 22 Aug 2017 20:03:07 -0400 python3: wrap all uses of <exception>.strerror with strtolocal
Augie Fackler <raf@durin42.com> [Tue, 22 Aug 2017 20:03:07 -0400] rev 34040
python3: wrap all uses of <exception>.strerror with strtolocal Our string literals are bytes, and we mostly want to %-format a strerror into a one of those literals, so this fixes a ton of issues.
Wed, 30 Aug 2017 14:04:55 -0700 pager: do not start pager if `ui` has been `pushbuffer`-ed
Jun Wu <quark@fb.com> [Wed, 30 Aug 2017 14:04:55 -0700] rev 34039
pager: do not start pager if `ui` has been `pushbuffer`-ed The `pushbuffer`, `popbuffer` APIs are intended to capture internal output. They will prevent `ui.write` from writing to the actual `ui.fout`. So a pager won't receive the output and do the right thing. In general, it does not make sense to start a pager if ui is in the "pushbuffer" mode. Differential Revision: https://phab.mercurial-scm.org/D574
Wed, 30 Aug 2017 16:05:12 -0700 revset: do not flip "and" arguments when optimizing
Jun Wu <quark@fb.com> [Wed, 30 Aug 2017 16:05:12 -0700] rev 34038
revset: do not flip "and" arguments when optimizing Rewrite `flipand(y, x)` to `andsmally(x, y)` so the AST order is unchanged, which could be more friendly to developers. Differential Revision: https://phab.mercurial-scm.org/D579
Wed, 30 Aug 2017 22:51:28 +0900 revset: make match function follow given subset if specified (API)
Yuya Nishihara <yuya@tcha.org> [Wed, 30 Aug 2017 22:51:28 +0900] rev 34037
revset: make match function follow given subset if specified (API) This should be sensible default since mfunc(subset) is roughly equivalent to 'subset & mfunc'. The order argument is still there so we can specify 'anyorder' if the order doesn't really matter.
Wed, 30 Aug 2017 22:41:36 +0900 revset: move order argument to run-time match function
Yuya Nishihara <yuya@tcha.org> [Wed, 30 Aug 2017 22:41:36 +0900] rev 34036
revset: move order argument to run-time match function We no longer need the order flag to build a parsed tree.
Wed, 30 Aug 2017 23:53:30 +0900 revset: fix example describing how ordering is determined
Yuya Nishihara <yuya@tcha.org> [Wed, 30 Aug 2017 23:53:30 +0900] rev 34035
revset: fix example describing how ordering is determined It was 'X & !Y' before.
Wed, 30 Aug 2017 22:32:47 +0900 revset: move order constants from revsetlang
Yuya Nishihara <yuya@tcha.org> [Wed, 30 Aug 2017 22:32:47 +0900] rev 34034
revset: move order constants from revsetlang Thanks to the recent refactor, the ordering rule is fully processed at runtime.
Tue, 29 Aug 2017 11:25:22 +0200 tag: use filtered repo when creating new tags (issue5539)
Denis Laxalde <denis@laxalde.org> [Tue, 29 Aug 2017 11:25:22 +0200] rev 34033
tag: use filtered repo when creating new tags (issue5539) When pruning a changeset that added a tag and then adding another tag, the "pruned" tag gets restored. This is because the tag creation step (tags._tag() call in tags.tag()) is currently done on the unfiltered repo. This behavior has been there from 7977d35df13b which backs out b08af8f0ac01 with no clear reason but caution on unthought situations at that time. In this changeset, we pass the filtered repo to tags._tag(), preventing "pruned" tags to reappear. This somehow restores b08af8f0ac01, though now we arguably have a valid use case for.
Mon, 21 Aug 2017 16:46:05 -0700 extensions: add wrappedfunction() context manager
Martin von Zweigbergk <martinvonz@google.com> [Mon, 21 Aug 2017 16:46:05 -0700] rev 34032
extensions: add wrappedfunction() context manager Several extensions exist that temporarily want to wrap a function (at least narrowhg, any many of the extensions in hg-experimental). That's why we have the unwrapfunction() that was introduced in 19578bb84731 (extensions: add unwrapfunction to undo wrapfunction, 2016-08-10). This patch adds a simple wrappedfunction() that returns a context manager. Differential Revision: https://phab.mercurial-scm.org/D472
Tue, 29 Aug 2017 18:20:50 -0700 mdiff: add a --ignore-space-at-eol option
David Soria Parra <davidsp@fb.com> [Tue, 29 Aug 2017 18:20:50 -0700] rev 34031
mdiff: add a --ignore-space-at-eol option Add an option that only ignores whitespaces at EOL. The name of the option is the same as Git. .. feature:: Added `--ignore-space-at-eol` diff option to ignore whitespace differences at line endings. Differential Revision: https://phab.mercurial-scm.org/D422
Fri, 25 Aug 2017 11:20:34 -0700 revset: improve documentation about ordering handling
Jun Wu <quark@fb.com> [Fri, 25 Aug 2017 11:20:34 -0700] rev 34030
revset: improve documentation about ordering handling The old documentation is a bit confusing. Namely, it's unclear whether `define` means "I should ALWAYS define a new order", or "I should SOMETIMES define a new order", and if it's the latter, what's the difference between `define` and `any`? This patch clarifies that and adds more examples. Differential Revision: https://phab.mercurial-scm.org/D523
Sun, 20 Aug 2017 10:55:11 -0700 revset: remove order information from tree (API)
Jun Wu <quark@fb.com> [Sun, 20 Aug 2017 10:55:11 -0700] rev 34029
revset: remove order information from tree (API) Keeping `order` in tree makes AST operation harder. And there could be invalid cases if trees could be generated and compounded freely, like: SetA(order=define) & SetB(order=define) ^^^^^^ couldn't be satisfied This patch changes the code to calculate order on the fly, during tree traversal. Optimization of reordering `and` arguments is preserved by introducing a new internal operation `flipand`. .. api:: revset.stringset() now takes 'order' as the last argument. Differential Revision: https://phab.mercurial-scm.org/D451
Mon, 28 Aug 2017 23:44:47 -0700 revset: drop optimization about reordering "or" set elements
Jun Wu <quark@fb.com> [Mon, 28 Aug 2017 23:44:47 -0700] rev 34028
revset: drop optimization about reordering "or" set elements The reordering optimization is more important for "and" than "or", given the implementation details about "addset" and "filteredset" - reordering "or" may help "__contains__" test but not iteration, reordering "and" could help both. We are going to simplify the tree to remove ordering information. Removing "or" reordering optimization would make things simpler. This effectively reverts c63cb2d10d6d. It tracks back to the "orset" function added by the initial commit of revset (c9ce8ecd6). In the future, we might consider optimization at runtime (ex. do reordering and rewrites inside "orset"). Differential Revision: https://phab.mercurial-scm.org/D561
Tue, 29 Aug 2017 17:51:54 -0700 rebase: use _ctxdesc in one more place
Jun Wu <quark@fb.com> [Tue, 29 Aug 2017 17:51:54 -0700] rev 34027
rebase: use _ctxdesc in one more place This simplifies the code. Differential Revision: https://phab.mercurial-scm.org/D566
Sun, 27 Aug 2017 02:47:47 -0700 rebase: move working parent and bookmark for obsoleted revs (BC)
Jun Wu <quark@fb.com> [Sun, 27 Aug 2017 02:47:47 -0700] rev 34026
rebase: move working parent and bookmark for obsoleted revs (BC) Previously, obsoleted revs with successors in destination are completely ignored. That caused some inconvenience when working copy is obsoleted. Most commands avoid working copy being obsoleted, but `hg pull` is an exception. This patch makes rebase able to move bookmarks or working parent for those obsoleted revs. It does so by keeping the obsoleted revs in `state` and marking them as "skipped, rebased to desired destination" during run-time. This reverts part of the behavior change of 3b7cb3d17137 and D24. Differential Revision: https://phab.mercurial-scm.org/D527
Tue, 29 Aug 2017 17:49:13 -0700 rebase: remove an unnecessary adjustdest in clearrebased
Jun Wu <quark@fb.com> [Tue, 29 Aug 2017 17:49:13 -0700] rev 34025
rebase: remove an unnecessary adjustdest in clearrebased `rev` being "skipped" could currently be caused by moving `rev` does not create a new commit. In this case, `state[rev]` is already changed to `p1`, and is a sane destination for bookmark or working parent movement. Therefore an additional destination adjustment is unnecessary. Differential Revision: https://phab.mercurial-scm.org/D565
Mon, 21 Aug 2017 20:22:07 -0700 rebase: sort destmap topologically
Jun Wu <quark@fb.com> [Mon, 21 Aug 2017 20:22:07 -0700] rev 34024
rebase: sort destmap topologically Previously rebase source and destination could not overlap. But with the multi-destination support, source and destination could reasonably partially overlap. That requires another topological sort on `{sourcerev: destrev}` graph (destmap). This patch implements that. If a revision's destination is itself, the error message gets changed from "source is ancestor of destination" to "source and destination form a cycle". Not marking as BC since automation should depend on exit code, not error message. Differential Revision: https://phab.mercurial-scm.org/D470
(0) -30000 -10000 -3000 -1000 -300 -100 -96 +96 +100 +300 +1000 +3000 +10000 tip