Wed, 02 May 2018 22:49:06 -0700 shortest: move some safe code out of exception block
Martin von Zweigbergk <martinvonz@google.com> [Wed, 02 May 2018 22:49:06 -0700] rev 37862
shortest: move some safe code out of exception block The RevlogError and WdirUnsupported could be raised by _partialmatch(), but not by the rest of isvalid(), so let's move the rest out to make it clearer. Differential Revision: https://phab.mercurial-scm.org/D3458
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
Fri, 06 Apr 2018 12:45:08 -0700 context: only bother looking for broken dirstate for 20-byte changeid
Martin von Zweigbergk <martinvonz@google.com> [Fri, 06 Apr 2018 12:45:08 -0700] rev 37855
context: only bother looking for broken dirstate for 20-byte changeid If we fail to look up a changeid in changectx.__init__, we check if it exactly matches any of the dirstate parents, and if it does, we print a more specific message ("working directory has unknown parent '...'!" instead of "unknown revision '...'"). The dirstate parents are always 20 bytes, so there's no need to check for a match when the given changeid is not 20 bytes. (And now that all the other allowed forms of changeid have been moved out of the constructor, there's no risk that a changeid that did match a dirstate parent was actually a valid bookmark.) Differential Revision: https://phab.mercurial-scm.org/D3450
Fri, 11 May 2018 20:10:22 +0900 revset: pass in lookup function to matchany() (issue5879) stable
Yuya Nishihara <yuya@tcha.org> [Fri, 11 May 2018 20:10:22 +0900] rev 37854
revset: pass in lookup function to matchany() (issue5879) Silly mistake in f83cb91b052e.
Fri, 11 May 2018 20:08:30 +0900 test-hgweb: add test for foo-bar name lookup stable
Yuya Nishihara <yuya@tcha.org> [Fri, 11 May 2018 20:08:30 +0900] rev 37853
test-hgweb: add test for foo-bar name lookup This is broken since f83cb91b052e "revset: pass in lookup function instead of repo (API)."
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 +10000 tip