##// END OF EJS Templates
diff: rename --relative option to --root...
Sean Farley -
r24455:16961d43 default
parent child Browse files
Show More
@@ -1008,7 +1008,7 b" def export(repo, revs, template='hg-%h.p"
1008
1008
1009 def diffordiffstat(ui, repo, diffopts, node1, node2, match,
1009 def diffordiffstat(ui, repo, diffopts, node1, node2, match,
1010 changes=None, stat=False, fp=None, prefix='',
1010 changes=None, stat=False, fp=None, prefix='',
1011 relative='', listsubrepos=False):
1011 root='', listsubrepos=False):
1012 '''show diff or diffstat.'''
1012 '''show diff or diffstat.'''
1013 if fp is None:
1013 if fp is None:
1014 write = ui.write
1014 write = ui.write
@@ -1016,8 +1016,8 b' def diffordiffstat(ui, repo, diffopts, n'
1016 def write(s, **kw):
1016 def write(s, **kw):
1017 fp.write(s)
1017 fp.write(s)
1018
1018
1019 if relative:
1019 if root:
1020 relroot = pathutil.canonpath(repo.root, repo.getcwd(), relative)
1020 relroot = pathutil.canonpath(repo.root, repo.getcwd(), root)
1021 else:
1021 else:
1022 relroot = ''
1022 relroot = ''
1023 if relroot != '':
1023 if relroot != '':
@@ -148,7 +148,7 b' diffopts2 = ['
148 ('U', 'unified', '',
148 ('U', 'unified', '',
149 _('number of lines of context to show'), _('NUM')),
149 _('number of lines of context to show'), _('NUM')),
150 ('', 'stat', None, _('output diffstat-style summary of changes')),
150 ('', 'stat', None, _('output diffstat-style summary of changes')),
151 ('', 'relative', '', _('produce diffs relative to subdirectory'), _('DIR')),
151 ('', 'root', '', _('produce diffs relative to subdirectory'), _('DIR')),
152 ]
152 ]
153
153
154 mergetoolopts = [
154 mergetoolopts = [
@@ -3171,7 +3171,7 b' def diff(ui, repo, *pats, **opts):'
3171 m = scmutil.match(repo[node2], pats, opts)
3171 m = scmutil.match(repo[node2], pats, opts)
3172 cmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat,
3172 cmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat,
3173 listsubrepos=opts.get('subrepos'),
3173 listsubrepos=opts.get('subrepos'),
3174 relative=opts.get('relative'))
3174 root=opts.get('root'))
3175
3175
3176 @command('^export',
3176 @command('^export',
3177 [('o', 'output', '',
3177 [('o', 'output', '',
@@ -203,7 +203,7 b' Show all commands + options'
203 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
203 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
204 clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd, insecure
204 clone: noupdate, updaterev, rev, branch, pull, uncompressed, ssh, remotecmd, insecure
205 commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos
205 commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos
206 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
206 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
207 export: output, switch-parent, rev, text, git, nodates
207 export: output, switch-parent, rev, text, git, nodates
208 forget: include, exclude
208 forget: include, exclude
209 init: ssh, remotecmd, insecure
209 init: ssh, remotecmd, insecure
@@ -47,7 +47,7 b' inside beta'
47 relative to beta
47 relative to beta
48
48
49 $ cd ..
49 $ cd ..
50 $ hg diff --nodates --relative beta
50 $ hg diff --nodates --root beta
51 diff -r 7d5ef1aea329 two
51 diff -r 7d5ef1aea329 two
52 --- a/two
52 --- a/two
53 +++ b/two
53 +++ b/two
@@ -57,7 +57,7 b' relative to beta'
57 inside beta
57 inside beta
58
58
59 $ cd beta
59 $ cd beta
60 $ hg diff --nodates --relative .
60 $ hg diff --nodates --root .
61 diff -r 7d5ef1aea329 two
61 diff -r 7d5ef1aea329 two
62 --- a/two
62 --- a/two
63 +++ b/two
63 +++ b/two
@@ -82,26 +82,26 b' diffstat within directories:'
82 dir2/new | 1 +
82 dir2/new | 1 +
83 2 files changed, 2 insertions(+), 0 deletions(-)
83 2 files changed, 2 insertions(+), 0 deletions(-)
84
84
85 $ hg diff --stat --relative dir1
85 $ hg diff --stat --root dir1
86 new | 1 +
86 new | 1 +
87 1 files changed, 1 insertions(+), 0 deletions(-)
87 1 files changed, 1 insertions(+), 0 deletions(-)
88
88
89 $ hg diff --stat --relative dir1 dir2
89 $ hg diff --stat --root dir1 dir2
90 warning: dir2 not inside relative root dir1
90 warning: dir2 not inside relative root dir1
91
91
92 $ hg diff --stat --relative dir1 -I dir1/old
92 $ hg diff --stat --root dir1 -I dir1/old
93
93
94 $ cd dir1
94 $ cd dir1
95 $ hg diff --stat .
95 $ hg diff --stat .
96 dir1/new | 1 +
96 dir1/new | 1 +
97 1 files changed, 1 insertions(+), 0 deletions(-)
97 1 files changed, 1 insertions(+), 0 deletions(-)
98 $ hg diff --stat --relative .
98 $ hg diff --stat --root .
99 new | 1 +
99 new | 1 +
100 1 files changed, 1 insertions(+), 0 deletions(-)
100 1 files changed, 1 insertions(+), 0 deletions(-)
101
101
102 $ hg diff --stat --relative ../dir1 ../dir2
102 $ hg diff --stat --root ../dir1 ../dir2
103 warning: ../dir2 not inside relative root .
103 warning: ../dir2 not inside relative root .
104
104
105 $ hg diff --stat --relative . -I old
105 $ hg diff --stat --root . -I old
106
106
107 $ cd ..
107 $ cd ..
@@ -45,11 +45,11 b' Copy:'
45
45
46 Cross and same-directory copies with a relative root:
46 Cross and same-directory copies with a relative root:
47
47
48 $ hg diff --git --relative .. -r 1:tip
48 $ hg diff --git --root .. -r 1:tip
49 abort: .. not under root '$TESTTMP'
49 abort: .. not under root '$TESTTMP'
50 [255]
50 [255]
51 $ hg diff --git --relative doesnotexist -r 1:tip
51 $ hg diff --git --root doesnotexist -r 1:tip
52 $ hg diff --git --relative . -r 1:tip
52 $ hg diff --git --root . -r 1:tip
53 diff --git a/dir1/new b/dir1/copy
53 diff --git a/dir1/new b/dir1/copy
54 copy from dir1/new
54 copy from dir1/new
55 copy to dir1/copy
55 copy to dir1/copy
@@ -66,7 +66,7 b' Cross and same-directory copies with a r'
66 @@ -1,1 +1,2 @@
66 @@ -1,1 +1,2 @@
67 new
67 new
68 +copy2
68 +copy2
69 $ hg diff --git --relative dir1 -r 1:tip
69 $ hg diff --git --root dir1 -r 1:tip
70 diff --git a/new b/copy
70 diff --git a/new b/copy
71 copy from new
71 copy from new
72 copy to copy
72 copy to copy
@@ -76,7 +76,7 b' Cross and same-directory copies with a r'
76 new
76 new
77 +copy1
77 +copy1
78
78
79 $ hg diff --git --relative dir2/ -r 1:tip
79 $ hg diff --git --root dir2/ -r 1:tip
80 diff --git a/copy b/copy
80 diff --git a/copy b/copy
81 new file mode 100644
81 new file mode 100644
82 --- /dev/null
82 --- /dev/null
@@ -85,7 +85,7 b' Cross and same-directory copies with a r'
85 +new
85 +new
86 +copy2
86 +copy2
87
87
88 $ hg diff --git --relative dir1 -r 1:tip -I '**/copy'
88 $ hg diff --git --root dir1 -r 1:tip -I '**/copy'
89 diff --git a/new b/copy
89 diff --git a/new b/copy
90 copy from new
90 copy from new
91 copy to copy
91 copy to copy
@@ -95,14 +95,14 b' Cross and same-directory copies with a r'
95 new
95 new
96 +copy1
96 +copy1
97
97
98 $ hg diff --git --relative dir1 -r 1:tip dir2
98 $ hg diff --git --root dir1 -r 1:tip dir2
99 warning: dir2 not inside relative root dir1
99 warning: dir2 not inside relative root dir1
100
100
101 $ hg diff --git --relative dir1 -r 1:tip 'dir2/{copy}'
101 $ hg diff --git --root dir1 -r 1:tip 'dir2/{copy}'
102 warning: dir2/{copy} not inside relative root dir1
102 warning: dir2/{copy} not inside relative root dir1
103
103
104 $ cd dir1
104 $ cd dir1
105 $ hg diff --git --relative .. -r 1:tip
105 $ hg diff --git --root .. -r 1:tip
106 diff --git a/dir1/new b/dir1/copy
106 diff --git a/dir1/new b/dir1/copy
107 copy from dir1/new
107 copy from dir1/new
108 copy to dir1/copy
108 copy to dir1/copy
@@ -120,11 +120,11 b' Cross and same-directory copies with a r'
120 new
120 new
121 +copy2
121 +copy2
122
122
123 $ hg diff --git --relative ../.. -r 1:tip
123 $ hg diff --git --root ../.. -r 1:tip
124 abort: ../.. not under root '$TESTTMP'
124 abort: ../.. not under root '$TESTTMP'
125 [255]
125 [255]
126 $ hg diff --git --relative ../doesnotexist -r 1:tip
126 $ hg diff --git --root ../doesnotexist -r 1:tip
127 $ hg diff --git --relative .. -r 1:tip
127 $ hg diff --git --root .. -r 1:tip
128 diff --git a/dir1/new b/dir1/copy
128 diff --git a/dir1/new b/dir1/copy
129 copy from dir1/new
129 copy from dir1/new
130 copy to dir1/copy
130 copy to dir1/copy
@@ -142,7 +142,7 b' Cross and same-directory copies with a r'
142 new
142 new
143 +copy2
143 +copy2
144
144
145 $ hg diff --git --relative . -r 1:tip
145 $ hg diff --git --root . -r 1:tip
146 diff --git a/new b/copy
146 diff --git a/new b/copy
147 copy from new
147 copy from new
148 copy to copy
148 copy to copy
@@ -151,7 +151,7 b' Cross and same-directory copies with a r'
151 @@ -1,1 +1,2 @@
151 @@ -1,1 +1,2 @@
152 new
152 new
153 +copy1
153 +copy1
154 $ hg diff --git --relative . -r 1:tip copy
154 $ hg diff --git --root . -r 1:tip copy
155 diff --git a/new b/copy
155 diff --git a/new b/copy
156 copy from new
156 copy from new
157 copy to copy
157 copy to copy
@@ -160,9 +160,9 b' Cross and same-directory copies with a r'
160 @@ -1,1 +1,2 @@
160 @@ -1,1 +1,2 @@
161 new
161 new
162 +copy1
162 +copy1
163 $ hg diff --git --relative . -r 1:tip ../dir2
163 $ hg diff --git --root . -r 1:tip ../dir2
164 warning: ../dir2 not inside relative root .
164 warning: ../dir2 not inside relative root .
165 $ hg diff --git --relative . -r 1:tip '../dir2/*'
165 $ hg diff --git --root . -r 1:tip '../dir2/*'
166 warning: ../dir2/* not inside relative root .
166 warning: ../dir2/* not inside relative root .
167 $ cd ..
167 $ cd ..
168
168
@@ -195,7 +195,7 b' Rename:'
195
195
196 Cross and same-directory renames with a relative root:
196 Cross and same-directory renames with a relative root:
197
197
198 $ hg diff --relative dir1 --git -r 2:tip
198 $ hg diff --root dir1 --git -r 2:tip
199 diff --git a/copy b/rename1
199 diff --git a/copy b/rename1
200 rename from copy
200 rename from copy
201 rename to rename1
201 rename to rename1
@@ -214,7 +214,7 b' Cross and same-directory renames with a '
214 +copy2
214 +copy2
215 +rename2
215 +rename2
216
216
217 $ hg diff --relative dir2 --git -r 2:tip
217 $ hg diff --root dir2 --git -r 2:tip
218 diff --git a/copy b/copy
218 diff --git a/copy b/copy
219 deleted file mode 100644
219 deleted file mode 100644
220 --- a/copy
220 --- a/copy
@@ -223,7 +223,7 b' Cross and same-directory renames with a '
223 -new
223 -new
224 -copy2
224 -copy2
225
225
226 $ hg diff --relative dir1 --git -r 2:tip -I '**/copy'
226 $ hg diff --root dir1 --git -r 2:tip -I '**/copy'
227 diff --git a/copy b/copy
227 diff --git a/copy b/copy
228 deleted file mode 100644
228 deleted file mode 100644
229 --- a/copy
229 --- a/copy
@@ -232,7 +232,7 b' Cross and same-directory renames with a '
232 -new
232 -new
233 -copy1
233 -copy1
234
234
235 $ hg diff --relative dir1 --git -r 2:tip -I '**/rename*'
235 $ hg diff --root dir1 --git -r 2:tip -I '**/rename*'
236 diff --git a/copy b/rename1
236 diff --git a/copy b/rename1
237 copy from copy
237 copy from copy
238 copy to rename1
238 copy to rename1
@@ -509,7 +509,7 b' Test command without options'
509 -B --ignore-blank-lines ignore changes whose lines are all blank
509 -B --ignore-blank-lines ignore changes whose lines are all blank
510 -U --unified NUM number of lines of context to show
510 -U --unified NUM number of lines of context to show
511 --stat output diffstat-style summary of changes
511 --stat output diffstat-style summary of changes
512 --relative DIR produce diffs relative to subdirectory
512 --root DIR produce diffs relative to subdirectory
513 -I --include PATTERN [+] include names matching the given patterns
513 -I --include PATTERN [+] include names matching the given patterns
514 -X --exclude PATTERN [+] exclude names matching the given patterns
514 -X --exclude PATTERN [+] exclude names matching the given patterns
515 -S --subrepos recurse into subrepositories
515 -S --subrepos recurse into subrepositories
General Comments 0
You need to be logged in to leave comments. Login now