Fri, 04 May 2018 22:04:44 -0700 revlog: don't say "not found" on internal error
Martin von Zweigbergk <martinvonz@google.com> [Fri, 04 May 2018 22:04:44 -0700] rev 37861
revlog: don't say "not found" on internal error If index_node() returned NULL, then index_find_node() and and nt_partialmatch() used to return -2 to signal that the node was not found. However, we were passing in a revnum to index_node() that we knew should exist, so the only reason it could return NULL was due to some internal error or perhaps out of memory. Let's not use "not found" for these cases. I suppose we never noticed this because these error never happen in practice. I think there are more places where we should error out instead of reporting that the node was not found, but the cases mentioned above were all I cared about right now (because using the same error code for all failures simplified some future patches). Differential Revision: https://phab.mercurial-scm.org/D3457
Fri, 04 May 2018 21:58:43 -0700 revlog: extract function for getting node from known-to-exist rev
Martin von Zweigbergk <martinvonz@google.com> [Fri, 04 May 2018 21:58:43 -0700] rev 37860
revlog: extract function for getting node from known-to-exist rev Many of the calls to index_node() (which converts a rev to a nodeid) are done with a rev that's know to exist. If the function fails, there's something really wrong and we should just abort. This was done in only one place. This patch starts by extracting that code to a function that we can reuse in later patches. Differential Revision: https://phab.mercurial-scm.org/D3456
Mon, 07 May 2018 09:15:29 -0700 shortest: make {shortest("fffffffff")} work again
Martin von Zweigbergk <martinvonz@google.com> [Mon, 07 May 2018 09:15:29 -0700] rev 37859
shortest: make {shortest("fffffffff")} work again {shortest("fffffffff")} should shorten it to the shortest unambiguous prefix for the working directory. It used to do that until I broke it in 7b2955624777 (scmutil: make shortesthexnodeidprefix() take a full binary nodeid, 2018-04-14), when we started returning the full hex nodeid for any working directory prefix shorter than 40 hex digits. This patch fixes it by catching WdirUnsupported specifically. Differential Revision: https://phab.mercurial-scm.org/D3455
Sun, 29 Apr 2018 14:29:09 -0700 revlog: use radix tree also for matching keys shorter than 4 hex digits
Martin von Zweigbergk <martinvonz@google.com> [Sun, 29 Apr 2018 14:29:09 -0700] rev 37858
revlog: use radix tree also for matching keys shorter than 4 hex digits I don't know what the reason for the 4-digit limit was, and I can't think of any real disadvantages of using the radix tree also when the requested minimum length is short. This speeds up `hg log -T '{shortest(node,1)}\n'` from 2m16s to 4.5s by making that not fall back to pure code. Differential Revision: https://phab.mercurial-scm.org/D3453
Fri, 06 Apr 2018 12:55:32 -0700 context: convert to hex for error message only for 20-byte changeid
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 12:55:32 -0700] rev 37857
context: convert to hex for error message only for 20-byte changeid Now that 20-byte strings unambiguously mean binary (or a bug), we can specialize the conversion to hex for that case. Differential Revision: https://phab.mercurial-scm.org/D3452
Fri, 06 Apr 2018 12:59:17 -0700 context: clarify that only one attempt is made to interpret changeid
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 12:59:17 -0700] rev 37856
context: clarify that only one attempt is made to interpret changeid We can now tell what type of revision specifier we have just by looking at it (we no longer attempt to interpret it in one way after the other -- that's now in scmutil.revsymbol()). Let's clarify this in the code by swithing to if/elif. Differential Revision: https://phab.mercurial-scm.org/D3451
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -6 +6 +10 +30 +100 +300 +1000 +3000 +10000 tip