##// END OF EJS Templates
diff: support diffing explicit files in subrepos...
Matt Harbison -
r42177:db26dbbe default
parent child Browse files
Show More
@@ -105,8 +105,10 b' Interaction with Mercurial Commands'
105 105 Subversion subrepositories will print a warning and abort.
106 106
107 107 :diff: diff does not recurse in subrepos unless -S/--subrepos is
108 specified. Changes are displayed as usual, on the subrepositories
109 elements. Subversion subrepositories are currently silently ignored.
108 specified. However, if you specify the full path of a file or
109 directory in a subrepo, it will be diffed even without
110 -S/--subrepos being specified. Subversion subrepositories are
111 currently silently ignored.
110 112
111 113 :files: files does not recurse into subrepos unless -S/--subrepos is
112 114 specified. However, if you specify the full path of a file or
@@ -129,19 +129,19 b' def diffordiffstat(ui, repo, diffopts, n'
129 129 for chunk, label in chunks:
130 130 ui.write(chunk, label=label)
131 131
132 if listsubrepos:
133 for subpath, sub in scmutil.itersubrepos(ctx1, ctx2):
134 tempnode2 = node2
135 try:
136 if node2 is not None:
137 tempnode2 = ctx2.substate[subpath][1]
138 except KeyError:
139 # A subrepo that existed in node1 was deleted between node1 and
140 # node2 (inclusive). Thus, ctx2's substate won't contain that
141 # subpath. The best we can do is to ignore it.
142 tempnode2 = None
143 submatch = matchmod.subdirmatcher(subpath, match)
144 subprefix = repo.wvfs.reljoin(prefix, subpath)
132 for subpath, sub in scmutil.itersubrepos(ctx1, ctx2):
133 tempnode2 = node2
134 try:
135 if node2 is not None:
136 tempnode2 = ctx2.substate[subpath][1]
137 except KeyError:
138 # A subrepo that existed in node1 was deleted between node1 and
139 # node2 (inclusive). Thus, ctx2's substate won't contain that
140 # subpath. The best we can do is to ignore it.
141 tempnode2 = None
142 submatch = matchmod.subdirmatcher(subpath, match)
143 subprefix = repo.wvfs.reljoin(prefix, subpath)
144 if listsubrepos or match.exact(subpath) or any(submatch.files()):
145 145 sub.diff(ui, diffopts, tempnode2, submatch, changes=changes,
146 146 stat=stat, fp=fp, prefix=subprefix)
147 147
@@ -1875,6 +1875,19 b" Test that '[paths]' is configured correc"
1875 1875 @@ -0,0 +1,1 @@
1876 1876 +bar
1877 1877
1878 $ hg diff -X '.hgsub*' --nodates s
1879 diff -r 000000000000 s/a
1880 --- /dev/null
1881 +++ b/s/a
1882 @@ -0,0 +1,1 @@
1883 +a
1884 $ hg diff -X '.hgsub*' --nodates s/a
1885 diff -r 000000000000 s/a
1886 --- /dev/null
1887 +++ b/s/a
1888 @@ -0,0 +1,1 @@
1889 +a
1890
1878 1891 $ cd ..
1879 1892
1880 1893 test for ssh exploit 2017-07-25
General Comments 0
You need to be logged in to leave comments. Login now