mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
smartlog: write all hashes from smartlog to .hg/hashes
Summary: The hashes in .hg/hashes can be used for bash/zsh completion Test Plan: Run `hg sl` in a repo. Check that .hg/completionhints contains the same hashes shown by `hg sl`. Reviewers: durham Reviewed By: durham Subscribers: #sourcecontrol Differential Revision: https://phabricator.fb.com/D2440503 Tasks: 8331035 Signature: t1:2440503:1442268630:c3bb3a52a301d2b6fa461158ccbd087c87e883a5
This commit is contained in:
parent
84c1720a00
commit
0e1385521f
@ -9,7 +9,7 @@ from mercurial import extensions, util, cmdutil, graphmod, templatekw, scmutil
|
||||
from mercurial import bookmarks, commands, error, revset
|
||||
from mercurial.extensions import wrapfunction
|
||||
from hgext import pager
|
||||
from mercurial.node import hex, nullrev
|
||||
from mercurial.node import hex, short, nullrev
|
||||
from mercurial.i18n import _
|
||||
import errno, os, re
|
||||
|
||||
@ -478,6 +478,13 @@ Excludes:
|
||||
showparents = [ctx.node() for ctx in repo[None].parents()]
|
||||
cmdutil.displaygraph(ui, revdag, displayer, showparents,
|
||||
graphmod.asciiedges, None, None)
|
||||
|
||||
with open(repo.join('completionhints'), 'w+') as f:
|
||||
for rev in revdag:
|
||||
commit_hash = rev[2].node()
|
||||
# Skip fakectxt nodes
|
||||
if commit_hash != '...':
|
||||
f.write(short(commit_hash) + '\n');
|
||||
finally:
|
||||
enabled = False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user