debugnamecomplete: show 9 digits for autocompleted rev numbers

Summary: Show 9 characters for autocompleted revs, to match rev numbers shown in e.g. `hg sl`. This makes it a little easier to verify the rev that was autocompleted for you matches the one you were looking at in the smart log (i.e. if you're looking at the end of the rev rather than the beginning).

Reviewed By: zzl0

Differential Revision: D46398818

fbshipit-source-id: 70f19d60df7aa85371e1c1838b362b621da5b493
This commit is contained in:
Michael Christensen 2023-06-05 11:12:48 -07:00 committed by Facebook GitHub Bot
parent 9b36c19d6d
commit 1ffac63e6d

View File

@ -2401,7 +2401,7 @@ def debugnamecomplete(ui, repo, *args, **opts) -> None:
age = ui.configint("zsh", "completion-age")
draft = repo.set("sort(draft() and age('<{}d'), -date)".format(age))
draft = [repo.changelog.shortest(cs.hex(), 8) for cs in draft]
draft = [repo.changelog.shortest(cs.hex(), 9) for cs in draft]
all_completions = []
all_completions.extend(draft)
all_completions.extend(sorted(n for n in names if n not in ["default", "tip"]))