Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 23507:67045b5a903a
graft: show hashes in user-facing messages
Graft was in various places just showing the revision number in status
messges. Instead, also show the stable and more useful short hash.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Tue, 09 Dec 2014 03:38:23 +0100 |
parents | dc82f1a7436d |
children | 2164226a5637 |
comparison
equal
deleted
inserted
replaced
23506:dc82f1a7436d | 23507:67045b5a903a |
---|---|
3394 # XXX make this lazy in the future | 3394 # XXX make this lazy in the future |
3395 revs = list(revs) | 3395 revs = list(revs) |
3396 # don't mutate while iterating, create a copy | 3396 # don't mutate while iterating, create a copy |
3397 for rev in list(revs): | 3397 for rev in list(revs): |
3398 if rev in ancestors: | 3398 if rev in ancestors: |
3399 ui.warn(_('skipping ancestor revision %s\n') % rev) | 3399 ui.warn(_('skipping ancestor revision %d:%s\n') % |
3400 (rev, repo[rev])) | |
3400 # XXX remove on list is slow | 3401 # XXX remove on list is slow |
3401 revs.remove(rev) | 3402 revs.remove(rev) |
3402 if not revs: | 3403 if not revs: |
3403 return -1 | 3404 return -1 |
3404 | 3405 |
3420 try: | 3421 try: |
3421 r = repo[n].rev() | 3422 r = repo[n].rev() |
3422 except error.RepoLookupError: | 3423 except error.RepoLookupError: |
3423 r = None | 3424 r = None |
3424 if r in revs: | 3425 if r in revs: |
3425 ui.warn(_('skipping revision %s (already grafted to %s)\n') | 3426 ui.warn(_('skipping revision %d:%s ' |
3426 % (r, rev)) | 3427 '(already grafted to %d:%s)\n') |
3428 % (r, repo[r], rev, ctx)) | |
3427 revs.remove(r) | 3429 revs.remove(r) |
3428 elif ids[n] in revs: | 3430 elif ids[n] in revs: |
3429 if r is None: | 3431 if r is None: |
3430 ui.warn(_('skipping already grafted revision %s ' | 3432 ui.warn(_('skipping already grafted revision %d:%s ' |
3431 '(%s also has unknown origin %s)\n') | 3433 '(%d:%s also has unknown origin %s)\n') |
3432 % (ids[n], rev, n)) | 3434 % (ids[n], repo[ids[n]], rev, ctx, n[:12])) |
3433 else: | 3435 else: |
3434 ui.warn(_('skipping already grafted revision %s ' | 3436 ui.warn(_('skipping already grafted revision %d:%s ' |
3435 '(%s also has origin %d)\n') | 3437 '(%d:%s also has origin %d:%s)\n') |
3436 % (ids[n], rev, r)) | 3438 % (ids[n], repo[ids[n]], rev, ctx, r, n[:12])) |
3437 revs.remove(ids[n]) | 3439 revs.remove(ids[n]) |
3438 elif ctx.hex() in ids: | 3440 elif ctx.hex() in ids: |
3439 r = ids[ctx.hex()] | 3441 r = ids[ctx.hex()] |
3440 ui.warn(_('skipping already grafted revision %s ' | 3442 ui.warn(_('skipping already grafted revision %d:%s ' |
3441 '(was grafted from %d)\n') % (r, rev)) | 3443 '(was grafted from %d:%s)\n') % |
3444 (r, repo[r], rev, ctx)) | |
3442 revs.remove(r) | 3445 revs.remove(r) |
3443 if not revs: | 3446 if not revs: |
3444 return -1 | 3447 return -1 |
3445 | 3448 |
3446 wlock = repo.wlock() | 3449 wlock = repo.wlock() |