##// END OF EJS Templates
summary: report copies and renames
Matt Mackall -
r11331:997ab9af default
parent child Browse files
Show More
@@ -3307,6 +3307,19 b' def summary(ui, repo, **opts):'
3307 3307
3308 3308 st = list(repo.status(unknown=True))[:6]
3309 3309
3310 c = repo.dirstate.copies()
3311 copied, renamed = [], []
3312 for d, s in c.iteritems():
3313 if s in st[2]:
3314 st[2].remove(s)
3315 renamed.append(d)
3316 else:
3317 copied.append(d)
3318 if d in st[1]:
3319 st[1].remove(d)
3320 st.insert(3, renamed)
3321 st.insert(4, copied)
3322
3310 3323 ms = mergemod.mergestate(repo)
3311 3324 st.append([f for f in ms if ms[f] == 'u'])
3312 3325
@@ -3316,6 +3329,8 b' def summary(ui, repo, **opts):'
3316 3329 labels = [ui.label(_('%d modified'), 'status.modified'),
3317 3330 ui.label(_('%d added'), 'status.added'),
3318 3331 ui.label(_('%d removed'), 'status.removed'),
3332 ui.label(_('%d renamed'), 'status.copied'),
3333 ui.label(_('%d copied'), 'status.copied'),
3319 3334 ui.label(_('%d deleted'), 'status.deleted'),
3320 3335 ui.label(_('%d unknown'), 'status.unknown'),
3321 3336 ui.label(_('%d ignored'), 'status.ignored'),
@@ -3336,7 +3351,7 b' def summary(ui, repo, **opts):'
3336 3351 elif (parents[0].extra().get('close') and
3337 3352 pnode in repo.branchheads(branch, closed=True)):
3338 3353 t += _(' (head closed)')
3339 elif (not st[0] and not st[1] and not st[2] and not st[7]):
3354 elif not (st[0] or st[1] or st[2] or st[3] or st[4] or st[9]):
3340 3355 t += _(' (clean)')
3341 3356 cleanworkdir = True
3342 3357 elif pnode not in bheads:
@@ -7,6 +7,7 b' hg commit -m "1" -d "1000000 0"'
7 7 hg status
8 8 hg copy a b
9 9 hg status
10 hg sum
10 11 hg --debug commit -m "2" -d "1000000 0"
11 12 echo "we should see two history entries"
12 13 hg history -v
@@ -1,4 +1,9 b''
1 1 A b
2 parent: 0:33aaa84a386b tip
3 1
4 branch: default
5 commit: 1 copied
6 update: (current)
2 7 b
3 8 b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
4 9 committed changeset 1:76973b01f66a012648546c979ea4c41de9e7d8cd
@@ -12,6 +12,7 b' hg commit -m "1" -d "1000000 0"'
12 12
13 13 echo "# rename a single file"
14 14 hg rename d1/d11/a1 d2/c
15 hg sum
15 16 hg status -C
16 17 hg update -C
17 18 rm d2/c
@@ -1,4 +1,9 b''
1 1 # rename a single file
2 parent: 0:6f9914c7a010 tip
3 1
4 branch: default
5 commit: 1 renamed
6 update: (current)
2 7 A d2/c
3 8 d1/d11/a1
4 9 R d1/d11/a1
General Comments 0
You need to be logged in to leave comments. Login now