##// END OF EJS Templates
subrepo: add argument to "diff()" to pass "ui" of caller side (issue3712) (API)...
FUJIWARA Katsunori -
r18006:0c10cf81 2.4.1 stable
parent child Browse files
Show More
@@ -627,7 +627,7 b' def diffordiffstat(ui, repo, diffopts, n'
627 # subpath. The best we can do is to ignore it.
627 # subpath. The best we can do is to ignore it.
628 tempnode2 = None
628 tempnode2 = None
629 submatch = matchmod.narrowmatcher(subpath, match)
629 submatch = matchmod.narrowmatcher(subpath, match)
630 sub.diff(diffopts, tempnode2, submatch, changes=changes,
630 sub.diff(ui, diffopts, tempnode2, submatch, changes=changes,
631 stat=stat, fp=fp, prefix=prefix)
631 stat=stat, fp=fp, prefix=prefix)
632
632
633 class changeset_printer(object):
633 class changeset_printer(object):
@@ -330,7 +330,7 b' class abstractsubrepo(object):'
330 def status(self, rev2, **opts):
330 def status(self, rev2, **opts):
331 return [], [], [], [], [], [], []
331 return [], [], [], [], [], [], []
332
332
333 def diff(self, diffopts, node2, match, prefix, **opts):
333 def diff(self, ui, diffopts, node2, match, prefix, **opts):
334 pass
334 pass
335
335
336 def outgoing(self, ui, dest, opts):
336 def outgoing(self, ui, dest, opts):
@@ -437,14 +437,14 b' class hgsubrepo(abstractsubrepo):'
437 % (inst, subrelpath(self)))
437 % (inst, subrelpath(self)))
438 return [], [], [], [], [], [], []
438 return [], [], [], [], [], [], []
439
439
440 def diff(self, diffopts, node2, match, prefix, **opts):
440 def diff(self, ui, diffopts, node2, match, prefix, **opts):
441 try:
441 try:
442 node1 = node.bin(self._state[1])
442 node1 = node.bin(self._state[1])
443 # We currently expect node2 to come from substate and be
443 # We currently expect node2 to come from substate and be
444 # in hex format
444 # in hex format
445 if node2 is not None:
445 if node2 is not None:
446 node2 = node.bin(node2)
446 node2 = node.bin(node2)
447 cmdutil.diffordiffstat(self._repo.ui, self._repo, diffopts,
447 cmdutil.diffordiffstat(ui, self._repo, diffopts,
448 node1, node2, match,
448 node1, node2, match,
449 prefix=os.path.join(prefix, self._path),
449 prefix=os.path.join(prefix, self._path),
450 listsubrepos=True, **opts)
450 listsubrepos=True, **opts)
@@ -125,6 +125,38 b' qrecord'
125 c
125 c
126 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m (esc)
126 \x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m (esc)
127
127
128 $ hg qpop -a
129 popping patch
130 patch queue now empty
131
128 #endif
132 #endif
129
133
134 issue3712: test colorization of subrepo diff
135
136 $ hg init sub
137 $ echo b > sub/b
138 $ hg -R sub commit -Am 'create sub'
139 adding b
140 $ echo 'sub = sub' > .hgsub
141 $ hg add .hgsub
142 $ hg commit -m 'add subrepo sub'
143 $ echo aa >> a
144 $ echo bb >> sub/b
145
146 $ hg diff --color=always -S
147 \x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
148 \x1b[0;31;1m--- a/a\x1b[0m (esc)
149 \x1b[0;32;1m+++ b/a\x1b[0m (esc)
150 \x1b[0;35m@@ -7,3 +7,4 @@\x1b[0m (esc)
151 a
152 c
153 c
154 \x1b[0;32m+aa\x1b[0m (esc)
155 \x1b[0;1mdiff --git a/sub/b b/sub/b\x1b[0m (esc)
156 \x1b[0;31;1m--- a/sub/b\x1b[0m (esc)
157 \x1b[0;32;1m+++ b/sub/b\x1b[0m (esc)
158 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
159 b
160 \x1b[0;32m+bb\x1b[0m (esc)
161
130 $ cd ..
162 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now