Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

status: use new wctx.diff() function when it is available

Remove old path before thg 1.2 is released

Changeset 49ddc74c3b03

Parent 4dc1120f899c

by Steve Borho

Changes to one file · Browse files at 49ddc74c3b03 Showing diff from parent 4dc1120f899c Diff from another changeset...

 
121
122
123
124
125
126
127
128
 
 
 
 
 
 
 
 
 
 
 
129
130
131
 
121
122
123
 
 
 
 
 
124
125
126
127
128
129
130
131
132
133
134
135
136
137
@@ -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()