sapling/hgext
Gregory Szorc 545ec2de44 show: use consistent (and possibly shorter) node lengths
`hg show` makes heavy use of shortest() to limit the length of the node
hash.

For the "stack" and "work" views, you are often looking at multiple
lines of similar output for "lines" of work. It is visually appeasing
for things to vertically align. A naive use of {shortest(node, N)}
could result in variable length nodes and for the first character of
the description to vary by a column or two.

We implement a function to determine the longest shortest prefix for
a set of revisions. The new function is used to determine the printed
node length for all `hg show` views.

.. feature::

   show: use consistent node length in views

Our previous shortest node length of 5 was arbitrarily chosen.

shortest() already does the work of ensuring that a partial node
isn't ambiguous with an integer revision, which is our primary risk
of a collision for very short nodes. It should be safe to go with the
shortest node possible.

Existing code is also optimized to handle nodes as short as 4.

So, we decrease the minimum hash length from 5 to 4.

We also add a test demonstrating that prefix collisions increase the
node length.

.. feature::

   show: decrease minimum displayed hash length from 5 to 4

Differential Revision: https://phab.mercurial-scm.org/D558
2017-09-13 21:15:46 -07:00
..
convert configitems: register the 'convert.svn.startrev' config 2017-06-30 03:36:46 +02:00
fsmonitor fsmonitor: correct an error message 2017-08-10 09:37:50 -07:00
highlight highlight: put pygments import inside demandimport.deactivated 2017-06-18 23:05:54 -04:00
largefiles merge: pass wctx to premerge, filemerge 2017-09-11 13:03:27 -07:00
zeroconf zeroconf: blindly forward extra argument to the core config method 2017-07-01 21:57:17 +02:00
__init__.py hgext: officially turn 'hgext' into a namespace package 2016-02-27 12:56:26 +01:00
acl.py configitem: create a new list of each 'acl.sources' access 2017-07-02 23:10:33 +02:00
amend.py amend: new extension providing the amend command 2017-07-11 20:53:55 -07:00
automv.py configitems: register the 'automv.similarity' config 2017-06-30 03:27:24 +02:00
blackbox.py blackbox: remove _bbvfs state 2017-09-06 21:12:27 -07:00
bugzilla.py bugzilla: move the default regexp for fix in the config declaration 2017-07-14 16:17:37 +02:00
censor.py revlog: rename constants (API) 2017-05-17 19:52:18 -07:00
children.py commands: move templates of common command options to cmdutil (API) 2017-05-14 16:19:47 +09:00
churn.py churn: use the non-deprecated template option in the examples 2017-05-08 23:05:01 -04:00
clonebundles.py clonebundles: fix missing newline character 2017-05-24 22:59:59 -04:00
commitextras.py commitextras: make sure keys are not empty 2017-07-30 12:19:46 +05:30
eol.py configitems: register the 'eol.only-consistent' config 2017-06-30 03:39:32 +02:00
extdiff.py cmdutil: rename template param to export to fntemplate 2017-05-20 20:15:05 -04:00
factotum.py configitems: register the 'factotum.service' config 2017-06-30 03:42:15 +02:00
fetch.py fetch: remove shorthand of --edit colliding against -e/-ssh in remoteopts (BC) 2017-06-24 02:39:13 +09:00
gpg.py commands: move templates of common command options to cmdutil (API) 2017-05-14 16:19:47 +09:00
graphlog.py commands: move templates of common command options to cmdutil (API) 2017-05-14 16:19:47 +09:00
hgk.py py3: introduce a wrapper for __builtins__.{raw_,}input() 2017-07-24 14:38:40 -04:00
histedit.py editor: use an unambiguous path suffix for editor files 2017-08-30 20:25:56 +00:00
journal.py codemod: register core configitems using a script 2017-07-14 14:22:40 -07:00
keyword.py cmdutil: remove redundant commitfunc parameter in amend (API) 2017-09-01 12:34:36 -07:00
logtoprocess.py logtoprocess: use lowercase for docstring title 2017-03-23 21:16:55 -07:00
mq.py configitems: register the 'mq.secret' config 2017-06-30 03:43:17 +02:00
notify.py configitems: register the 'notify.test' config 2017-06-30 03:43:31 +02:00
pager.py pager: if old pager extensions is enabled, respect pager.attend 2017-03-13 21:43:17 -07:00
patchbomb.py configitems: register the 'patchbomb.publicurl' config 2017-06-30 03:43:43 +02:00
purge.py commands: move templates of common command options to cmdutil (API) 2017-05-14 16:19:47 +09:00
rebase.py rebase: remove unnecessary '.unfiltered()' calls 2017-09-06 16:17:04 -07:00
record.py commands: move templates of common command options to cmdutil (API) 2017-05-14 16:19:47 +09:00
releasenotes.py releasenotes: view admonition titles using -l flag 2017-08-28 04:11:58 +05:30
relink.py registrar: move cmdutil.command to registrar module (API) 2016-01-09 23:07:20 +09:00
schemes.py schemes: use br'' literal to define bytes regexp 2017-03-09 19:41:40 -08:00
share.py bookmark: deprecate 'recordchange' in favor of 'applychanges' 2017-07-10 20:10:03 +02:00
shelve.py dirstate: update backup functions to take full backup filename 2017-07-12 15:24:07 -07:00
show.py show: use consistent (and possibly shorter) node lengths 2017-09-13 21:15:46 -07:00
sparse.py sparse: treat paths as cwd-relative 2017-08-04 05:38:22 -07:00
strip.py bookmark: use 'applychanges' when stripping 2017-07-10 17:37:48 +02:00
transplant.py registrar: move cmdutil.command to registrar module (API) 2016-01-09 23:07:20 +09:00
win32mbcs.py configitems: register the 'win32mbcs.encoding' config 2017-06-30 03:45:54 +02:00
win32text.py configitems: register the 'win32text.warn' config 2017-06-30 03:45:56 +02:00