Changeset 49ddc74c3b03…
Parent 4dc1120f899c…
by
Changes to one file · Browse files at 49ddc74c3b03 Showing diff from parent 4dc1120f899c Diff from another changeset...
@@ -121,11 +121,17 @@ hu = htmlui.htmlui()
try:
m = cmdutil.matchfiles(self.repo, [wfile])
- opts = mdiff.diffopts(git=True, nodates=True)
- n2, n1 = None, self.wctx.p1().node()
- for s, l in patch.difflabel(patch.diff, self.repo, n1, n2,
- match=m, opts=opts):
- hu.write(s, label=l)
+ try:
+ for s, l in patch.difflabel(self.wctx.diff, match=m):
+ hu.write(s, label=l)
+ except AttributeError:
+ # your mercurial source is not new enough, falling back
+ # to manual patch.diff() call
+ opts = mdiff.diffopts(git=True, nodates=True)
+ n2, n1 = None, self.wctx.p1().node()
+ for s, l in patch.difflabel(patch.diff, self.repo, n1, n2,
+ match=m, opts=opts):
+ hu.write(s, label=l)
except (IOError, error.RepoError, error.LookupError, util.Abort), e:
self.status_error = str(e)
o, e = hu.getdata()
|
Loading...