Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 11331:997ab9af81df
summary: report copies and renames
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 09 Jun 2010 16:39:25 -0500 |
parents | 40c06bbf58be |
children | 3dfbe26cfded |
comparison
equal
deleted
inserted
replaced
11330:713ae78bb583 | 11331:997ab9af81df |
---|---|
3305 else: | 3305 else: |
3306 ui.status(m, label='log.branch') | 3306 ui.status(m, label='log.branch') |
3307 | 3307 |
3308 st = list(repo.status(unknown=True))[:6] | 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 ms = mergemod.mergestate(repo) | 3323 ms = mergemod.mergestate(repo) |
3311 st.append([f for f in ms if ms[f] == 'u']) | 3324 st.append([f for f in ms if ms[f] == 'u']) |
3312 | 3325 |
3313 subs = [s for s in ctx.substate if ctx.sub(s).dirty()] | 3326 subs = [s for s in ctx.substate if ctx.sub(s).dirty()] |
3314 st.append(subs) | 3327 st.append(subs) |
3315 | 3328 |
3316 labels = [ui.label(_('%d modified'), 'status.modified'), | 3329 labels = [ui.label(_('%d modified'), 'status.modified'), |
3317 ui.label(_('%d added'), 'status.added'), | 3330 ui.label(_('%d added'), 'status.added'), |
3318 ui.label(_('%d removed'), 'status.removed'), | 3331 ui.label(_('%d removed'), 'status.removed'), |
3332 ui.label(_('%d renamed'), 'status.copied'), | |
3333 ui.label(_('%d copied'), 'status.copied'), | |
3319 ui.label(_('%d deleted'), 'status.deleted'), | 3334 ui.label(_('%d deleted'), 'status.deleted'), |
3320 ui.label(_('%d unknown'), 'status.unknown'), | 3335 ui.label(_('%d unknown'), 'status.unknown'), |
3321 ui.label(_('%d ignored'), 'status.ignored'), | 3336 ui.label(_('%d ignored'), 'status.ignored'), |
3322 ui.label(_('%d unresolved'), 'resolve.unresolved'), | 3337 ui.label(_('%d unresolved'), 'resolve.unresolved'), |
3323 ui.label(_('%d subrepos'), 'status.modified')] | 3338 ui.label(_('%d subrepos'), 'status.modified')] |
3334 elif branch != parents[0].branch(): | 3349 elif branch != parents[0].branch(): |
3335 t += _(' (new branch)') | 3350 t += _(' (new branch)') |
3336 elif (parents[0].extra().get('close') and | 3351 elif (parents[0].extra().get('close') and |
3337 pnode in repo.branchheads(branch, closed=True)): | 3352 pnode in repo.branchheads(branch, closed=True)): |
3338 t += _(' (head closed)') | 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 t += _(' (clean)') | 3355 t += _(' (clean)') |
3341 cleanworkdir = True | 3356 cleanworkdir = True |
3342 elif pnode not in bheads: | 3357 elif pnode not in bheads: |
3343 t += _(' (new branch head)') | 3358 t += _(' (new branch head)') |
3344 | 3359 |