mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
summary: add subrepo status
This commit is contained in:
parent
9642b7288d
commit
1d338ff2d8
@ -3109,15 +3109,21 @@ def summary(ui, repo, **opts):
|
||||
ui.status(m, label='log.branch')
|
||||
|
||||
st = list(repo.status(unknown=True))[:6]
|
||||
|
||||
ms = mergemod.mergestate(repo)
|
||||
st.append([f for f in ms if ms[f] == 'u'])
|
||||
|
||||
subs = [s for s in ctx.substate if ctx.sub(s).dirty()]
|
||||
st.append(subs)
|
||||
|
||||
labels = [ui.label(_('%d modified'), 'status.modified'),
|
||||
ui.label(_('%d added'), 'status.added'),
|
||||
ui.label(_('%d removed'), 'status.removed'),
|
||||
ui.label(_('%d deleted'), 'status.deleted'),
|
||||
ui.label(_('%d unknown'), 'status.unknown'),
|
||||
ui.label(_('%d ignored'), 'status.ignored'),
|
||||
ui.label(_('%d unresolved'), 'resolve.unresolved')]
|
||||
ui.label(_('%d unresolved'), 'resolve.unresolved'),
|
||||
ui.label(_('%d subrepos'), 'status.modified')]
|
||||
t = []
|
||||
for s, l in zip(st, labels):
|
||||
if s:
|
||||
@ -3130,7 +3136,7 @@ def summary(ui, repo, **opts):
|
||||
t += _(' (merge)')
|
||||
elif branch != parents[0].branch():
|
||||
t += _(' (new branch)')
|
||||
elif (not st[0] and not st[1] and not st[2]):
|
||||
elif (not st[0] and not st[1] and not st[2] and not st[7]):
|
||||
t += _(' (clean)')
|
||||
cleanworkdir = True
|
||||
elif pnode not in bheads:
|
||||
|
@ -16,6 +16,7 @@ hg add .hgsub
|
||||
hg init s
|
||||
echo a > s/a
|
||||
hg -R s ci -Ams0
|
||||
hg sum
|
||||
hg ci -m1
|
||||
|
||||
echo % add sub sub
|
||||
@ -24,7 +25,9 @@ hg init s/ss
|
||||
echo a > s/ss/a
|
||||
hg -R s add s/.hgsub
|
||||
hg -R s/ss add s/ss/a
|
||||
hg sum
|
||||
hg ci -m2
|
||||
hg sum
|
||||
|
||||
echo % bump sub rev
|
||||
echo b > s/a
|
||||
|
@ -2,10 +2,25 @@
|
||||
adding a
|
||||
% add first sub
|
||||
adding a
|
||||
parent: 0:f7b1eb17ad24 tip
|
||||
0
|
||||
branch: default
|
||||
commit: 1 added, 1 subrepos
|
||||
update: (current)
|
||||
committing subrepository s
|
||||
% add sub sub
|
||||
parent: 1:7cf8cfea66e4 tip
|
||||
1
|
||||
branch: default
|
||||
commit: 1 subrepos
|
||||
update: (current)
|
||||
committing subrepository s
|
||||
committing subrepository ss
|
||||
parent: 2:df30734270ae tip
|
||||
2
|
||||
branch: default
|
||||
commit: (clean)
|
||||
update: (current)
|
||||
% bump sub rev
|
||||
committing subrepository s
|
||||
% leave sub dirty
|
||||
|
Loading…
Reference in New Issue
Block a user