# HG changeset patch # User Brendan Cully # Date 1153320736 25200 # Node ID 001703ec311d7f92f40f39a7b93e71aef0d59560 # Parent 8dadff054acf96806ecd85b264f5e8e2456420cc Add an option '-C|--copies' to hg status to show the source of copied files. Copied files are displayed in the form: A newname oldname diff -r 8dadff054acf -r 001703ec311d mercurial/commands.py --- a/mercurial/commands.py Wed Jul 19 07:51:56 2006 -0700 +++ b/mercurial/commands.py Wed Jul 19 07:52:16 2006 -0700 @@ -2609,6 +2609,7 @@ ! = deleted, but still tracked ? = not tracked I = ignored (not shown by default) + = the previous added file was copied from here """ show_ignored = opts['ignored'] and True or False @@ -2637,6 +2638,9 @@ for f in changes: ui.write(format % f) + if (opts.get('copies') and not opts.get('no_status') + and opt == 'added' and repo.dirstate.copies.has_key(f)): + ui.write(' %s%s' % (repo.dirstate.copies[f], end)) def tag(ui, repo, name, rev_=None, **opts): """add a tag for the current tip or a given revision @@ -3126,6 +3130,7 @@ ('u', 'unknown', None, _('show only unknown (not tracked) files')), ('i', 'ignored', None, _('show ignored files')), ('n', 'no-status', None, _('hide status prefix')), + ('C', 'copies', None, _('show source of copied files')), ('0', 'print0', None, _('end filenames with NUL, for use with xargs')), ('I', 'include', [], _('include names matching the given patterns')), diff -r 8dadff054acf -r 001703ec311d tests/test-status --- a/tests/test-status Wed Jul 19 07:51:56 2006 -0700 +++ b/tests/test-status Wed Jul 19 07:52:16 2006 -0700 @@ -32,3 +32,6 @@ hg status echo "hg status modified added removed deleted unknown never-existed ignored:" hg status modified added removed deleted unknown never-existed ignored +hg copy modified copied +echo "hg status -C:" +hg status -C diff -r 8dadff054acf -r 001703ec311d tests/test-status.out --- a/tests/test-status.out Wed Jul 19 07:51:56 2006 -0700 +++ b/tests/test-status.out Wed Jul 19 07:52:16 2006 -0700 @@ -101,3 +101,10 @@ ! deleted ? ignored ? unknown +hg status -C: +A added +A copied + modified +R removed +! deleted +? unknown