# HG changeset patch # User Sean Farley # Date 1427309715 25200 # Node ID 16961d43dc890b3352a9833f50da9913408dff3e # Parent 59904edf0a5e38e70d04f6d9693ac2a97e5dbe8d diff: rename --relative option to --root The diff output format is unable to express files outside the directory so it makes sense to name this option --root instead of --relative. diff -r 59904edf0a5e -r 16961d43dc89 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Wed Mar 25 15:58:31 2015 -0400 +++ b/mercurial/cmdutil.py Wed Mar 25 11:55:15 2015 -0700 @@ -1008,7 +1008,7 @@ def diffordiffstat(ui, repo, diffopts, node1, node2, match, changes=None, stat=False, fp=None, prefix='', - relative='', listsubrepos=False): + root='', listsubrepos=False): '''show diff or diffstat.''' if fp is None: write = ui.write @@ -1016,8 +1016,8 @@ def write(s, **kw): fp.write(s) - if relative: - relroot = pathutil.canonpath(repo.root, repo.getcwd(), relative) + if root: + relroot = pathutil.canonpath(repo.root, repo.getcwd(), root) else: relroot = '' if relroot != '': diff -r 59904edf0a5e -r 16961d43dc89 mercurial/commands.py --- a/mercurial/commands.py Wed Mar 25 15:58:31 2015 -0400 +++ b/mercurial/commands.py Wed Mar 25 11:55:15 2015 -0700 @@ -148,7 +148,7 @@ ('U', 'unified', '', _('number of lines of context to show'), _('NUM')), ('', 'stat', None, _('output diffstat-style summary of changes')), - ('', 'relative', '', _('produce diffs relative to subdirectory'), _('DIR')), + ('', 'root', '', _('produce diffs relative to subdirectory'), _('DIR')), ] mergetoolopts = [ @@ -3171,7 +3171,7 @@ m = scmutil.match(repo[node2], pats, opts) cmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat, listsubrepos=opts.get('subrepos'), - relative=opts.get('relative')) + root=opts.get('root')) @command('^export', [('o', 'output', '', diff -r 59904edf0a5e -r 16961d43dc89 tests/test-completion.t --- a/tests/test-completion.t Wed Mar 25 15:58:31 2015 -0400 +++ b/tests/test-completion.t Wed Mar 25 11:55:15 2015 -0700 @@ -203,7 +203,7 @@ annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, ignore-all-space, ignore-space-change, ignore-blank-lines, include, exclude, template clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd, insecure commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos - diff: rev, change, text, git, nodates, noprefix, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, relative, include, exclude, subrepos + diff: rev, change, text, git, nodates, noprefix, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, root, include, exclude, subrepos export: output, switch-parent, rev, text, git, nodates forget: include, exclude init: ssh, remotecmd, insecure diff -r 59904edf0a5e -r 16961d43dc89 tests/test-diff-subdir.t --- a/tests/test-diff-subdir.t Wed Mar 25 15:58:31 2015 -0400 +++ b/tests/test-diff-subdir.t Wed Mar 25 11:55:15 2015 -0700 @@ -47,7 +47,7 @@ relative to beta $ cd .. - $ hg diff --nodates --relative beta + $ hg diff --nodates --root beta diff -r 7d5ef1aea329 two --- a/two +++ b/two @@ -57,7 +57,7 @@ inside beta $ cd beta - $ hg diff --nodates --relative . + $ hg diff --nodates --root . diff -r 7d5ef1aea329 two --- a/two +++ b/two diff -r 59904edf0a5e -r 16961d43dc89 tests/test-diffstat.t --- a/tests/test-diffstat.t Wed Mar 25 15:58:31 2015 -0400 +++ b/tests/test-diffstat.t Wed Mar 25 11:55:15 2015 -0700 @@ -82,26 +82,26 @@ dir2/new | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) - $ hg diff --stat --relative dir1 + $ hg diff --stat --root dir1 new | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) - $ hg diff --stat --relative dir1 dir2 + $ hg diff --stat --root dir1 dir2 warning: dir2 not inside relative root dir1 - $ hg diff --stat --relative dir1 -I dir1/old + $ hg diff --stat --root dir1 -I dir1/old $ cd dir1 $ hg diff --stat . dir1/new | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) - $ hg diff --stat --relative . + $ hg diff --stat --root . new | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) - $ hg diff --stat --relative ../dir1 ../dir2 + $ hg diff --stat --root ../dir1 ../dir2 warning: ../dir2 not inside relative root . - $ hg diff --stat --relative . -I old + $ hg diff --stat --root . -I old $ cd .. diff -r 59904edf0a5e -r 16961d43dc89 tests/test-git-export.t --- a/tests/test-git-export.t Wed Mar 25 15:58:31 2015 -0400 +++ b/tests/test-git-export.t Wed Mar 25 11:55:15 2015 -0700 @@ -45,11 +45,11 @@ Cross and same-directory copies with a relative root: - $ hg diff --git --relative .. -r 1:tip + $ hg diff --git --root .. -r 1:tip abort: .. not under root '$TESTTMP' [255] - $ hg diff --git --relative doesnotexist -r 1:tip - $ hg diff --git --relative . -r 1:tip + $ hg diff --git --root doesnotexist -r 1:tip + $ hg diff --git --root . -r 1:tip diff --git a/dir1/new b/dir1/copy copy from dir1/new copy to dir1/copy @@ -66,7 +66,7 @@ @@ -1,1 +1,2 @@ new +copy2 - $ hg diff --git --relative dir1 -r 1:tip + $ hg diff --git --root dir1 -r 1:tip diff --git a/new b/copy copy from new copy to copy @@ -76,7 +76,7 @@ new +copy1 - $ hg diff --git --relative dir2/ -r 1:tip + $ hg diff --git --root dir2/ -r 1:tip diff --git a/copy b/copy new file mode 100644 --- /dev/null @@ -85,7 +85,7 @@ +new +copy2 - $ hg diff --git --relative dir1 -r 1:tip -I '**/copy' + $ hg diff --git --root dir1 -r 1:tip -I '**/copy' diff --git a/new b/copy copy from new copy to copy @@ -95,14 +95,14 @@ new +copy1 - $ hg diff --git --relative dir1 -r 1:tip dir2 + $ hg diff --git --root dir1 -r 1:tip dir2 warning: dir2 not inside relative root dir1 - $ hg diff --git --relative dir1 -r 1:tip 'dir2/{copy}' + $ hg diff --git --root dir1 -r 1:tip 'dir2/{copy}' warning: dir2/{copy} not inside relative root dir1 $ cd dir1 - $ hg diff --git --relative .. -r 1:tip + $ hg diff --git --root .. -r 1:tip diff --git a/dir1/new b/dir1/copy copy from dir1/new copy to dir1/copy @@ -120,11 +120,11 @@ new +copy2 - $ hg diff --git --relative ../.. -r 1:tip + $ hg diff --git --root ../.. -r 1:tip abort: ../.. not under root '$TESTTMP' [255] - $ hg diff --git --relative ../doesnotexist -r 1:tip - $ hg diff --git --relative .. -r 1:tip + $ hg diff --git --root ../doesnotexist -r 1:tip + $ hg diff --git --root .. -r 1:tip diff --git a/dir1/new b/dir1/copy copy from dir1/new copy to dir1/copy @@ -142,7 +142,7 @@ new +copy2 - $ hg diff --git --relative . -r 1:tip + $ hg diff --git --root . -r 1:tip diff --git a/new b/copy copy from new copy to copy @@ -151,7 +151,7 @@ @@ -1,1 +1,2 @@ new +copy1 - $ hg diff --git --relative . -r 1:tip copy + $ hg diff --git --root . -r 1:tip copy diff --git a/new b/copy copy from new copy to copy @@ -160,9 +160,9 @@ @@ -1,1 +1,2 @@ new +copy1 - $ hg diff --git --relative . -r 1:tip ../dir2 + $ hg diff --git --root . -r 1:tip ../dir2 warning: ../dir2 not inside relative root . - $ hg diff --git --relative . -r 1:tip '../dir2/*' + $ hg diff --git --root . -r 1:tip '../dir2/*' warning: ../dir2/* not inside relative root . $ cd .. @@ -195,7 +195,7 @@ Cross and same-directory renames with a relative root: - $ hg diff --relative dir1 --git -r 2:tip + $ hg diff --root dir1 --git -r 2:tip diff --git a/copy b/rename1 rename from copy rename to rename1 @@ -214,7 +214,7 @@ +copy2 +rename2 - $ hg diff --relative dir2 --git -r 2:tip + $ hg diff --root dir2 --git -r 2:tip diff --git a/copy b/copy deleted file mode 100644 --- a/copy @@ -223,7 +223,7 @@ -new -copy2 - $ hg diff --relative dir1 --git -r 2:tip -I '**/copy' + $ hg diff --root dir1 --git -r 2:tip -I '**/copy' diff --git a/copy b/copy deleted file mode 100644 --- a/copy @@ -232,7 +232,7 @@ -new -copy1 - $ hg diff --relative dir1 --git -r 2:tip -I '**/rename*' + $ hg diff --root dir1 --git -r 2:tip -I '**/rename*' diff --git a/copy b/rename1 copy from copy copy to rename1 diff -r 59904edf0a5e -r 16961d43dc89 tests/test-help.t --- a/tests/test-help.t Wed Mar 25 15:58:31 2015 -0400 +++ b/tests/test-help.t Wed Mar 25 11:55:15 2015 -0700 @@ -509,7 +509,7 @@ -B --ignore-blank-lines ignore changes whose lines are all blank -U --unified NUM number of lines of context to show --stat output diffstat-style summary of changes - --relative DIR produce diffs relative to subdirectory + --root DIR produce diffs relative to subdirectory -I --include PATTERN [+] include names matching the given patterns -X --exclude PATTERN [+] exclude names matching the given patterns -S --subrepos recurse into subrepositories