##// END OF EJS Templates
subrepo: adjust subrepo prefix before calling subrepo.diff() (API)...
Martin von Zweigbergk -
r41779:3d094bfa default
parent child Browse files
Show More
@@ -123,8 +123,9 b' def diffordiffstat(ui, repo, diffopts, n'
123 123 # subpath. The best we can do is to ignore it.
124 124 tempnode2 = None
125 125 submatch = matchmod.subdirmatcher(subpath, match)
126 subprefix = repo.wvfs.reljoin(prefix, subpath)
126 127 sub.diff(ui, diffopts, tempnode2, submatch, changes=changes,
127 stat=stat, fp=fp, prefix=prefix)
128 stat=stat, fp=fp, prefix=subprefix)
128 129
129 130 class changesetdiffer(object):
130 131 """Generate diff of changeset with pre-configured filtering functions"""
@@ -11,7 +11,6 b' import copy'
11 11 import errno
12 12 import hashlib
13 13 import os
14 import posixpath
15 14 import re
16 15 import stat
17 16 import subprocess
@@ -556,10 +555,9 b' class hgsubrepo(abstractsubrepo):'
556 555 # in hex format
557 556 if node2 is not None:
558 557 node2 = node.bin(node2)
559 logcmdutil.diffordiffstat(ui, self._repo, diffopts,
560 node1, node2, match,
561 prefix=posixpath.join(prefix, self._path),
562 listsubrepos=True, **opts)
558 logcmdutil.diffordiffstat(ui, self._repo, diffopts, node1, node2,
559 match, prefix=prefix, listsubrepos=True,
560 **opts)
563 561 except error.RepoLookupError as inst:
564 562 self.ui.warn(_('warning: error "%s" in subrepository "%s"\n')
565 563 % (inst, subrelpath(self)))
@@ -1779,14 +1777,12 b' class gitsubrepo(abstractsubrepo):'
1779 1777 # for Git, this also implies '-p'
1780 1778 cmd.append('-U%d' % diffopts.context)
1781 1779
1782 gitprefix = self.wvfs.reljoin(prefix, self._path)
1783
1784 1780 if diffopts.noprefix:
1785 cmd.extend(['--src-prefix=%s/' % gitprefix,
1786 '--dst-prefix=%s/' % gitprefix])
1781 cmd.extend(['--src-prefix=%s/' % prefix,
1782 '--dst-prefix=%s/' % prefix])
1787 1783 else:
1788 cmd.extend(['--src-prefix=a/%s/' % gitprefix,
1789 '--dst-prefix=b/%s/' % gitprefix])
1784 cmd.extend(['--src-prefix=a/%s/' % prefix,
1785 '--dst-prefix=b/%s/' % prefix])
1790 1786
1791 1787 if diffopts.ignorews:
1792 1788 cmd.append('--ignore-all-space')
General Comments 0
You need to be logged in to leave comments. Login now