Changeset 071ea4834dc4…
Parent 9de54536f753…
by
Changes to 3 files · Browse files at 071ea4834dc4 Showing diff from parent 9de54536f753 Diff from another changeset...
@@ -744,8 +744,8 @@ if not self.curfile:
return
- opts = {'bundle':self.bfile}
rev = self.currev
+ opts = {'change':str(rev), 'bundle':self.bfile}
parents = self.repo[rev].parents()
if len(parents) == 2:
if self.diff_other_parent():
@@ -753,8 +753,6 @@ else:
parent = parents[0].rev()
opts['rev'] = [str(parent), str(rev)]
- else:
- opts['change'] = str(rev)
self._do_diff([self.curfile], opts)
|
@@ -1494,8 +1494,8 @@ dlg.hide()
def vdiff_change(self, menuitem, pats=[]):
- opts = {'bundle':self.bfile}
rev = self.currevid
+ opts = {'change':str(rev), 'bundle':self.bfile}
parents = self.repo[rev].parents()
if len(parents) == 2:
if self.changeview.diff_other_parent():
@@ -1503,8 +1503,6 @@ else:
parent = parents[0].rev()
opts['rev'] = [str(parent), str(rev)]
- else:
- opts['change'] = str(rev)
self._do_diff(pats, opts)
def vdiff_local(self, menuitem, pats=[]):
|
@@ -307,6 +307,15 @@ ui.warn(_('Extdiff command not recognized\n'))
return
pats = hglib.canonpaths(pats)
+
+ # if both --change and --rev is given, remove --rev in 3-way mode,
+ # and --change in normal mode
+ if 'change' in opts and 'rev' in opts:
+ if '$parent2' in ''.join(diffopts):
+ del opts['rev']
+ else:
+ del opts['change']
+
try:
ret = extdiff.dodiff(ui, repo, diffcmd, diffopts, pats, opts)
except OSError, e:
@@ -347,6 +356,11 @@ os.chdir(oldcwd)
return None
else:
+ # prefer --rev over --change for internal diff handling since we can
+ # only diff against a single parent at a time for merge changesets
+ if 'change' in opts and 'rev' in opts:
+ del opts['change']
+
pats = hglib.canonpaths(pats)
if opts.get('canonpats'):
pats = list(pats) + opts['canonpats']
|
Loading...