Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

status: prevent traceback on diff failure

difftext.close() was failing in the finally clause because
difftext starts out life as a list instead of a cStringIO.
I renamed the initial list to difflines and moved the patch
iterator out of the try: finally: scope

Changeset 315aae10a19e

Parent 6791db9c9794

by Steve Borho

Changes to one file · Browse files at 315aae10a19e Showing diff from parent 6791db9c9794 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​status.py Stacked
 
913
914
915
 
 
 
 
 
 
 
 
916
917
918
919
920
921
922
923
924
925
 
926
927
928
 
913
914
915
916
917
918
919
920
921
922
923
924
 
 
 
 
 
 
 
 
 
925
926
927
928
@@ -913,16 +913,16 @@
    def dohgdiff():   self.diff_model.clear() + difflines = [] + if len(files) != 0: + wfiles = [self.repo.wjoin(x) for x in files] + matcher = cmdutil.match(self.repo, wfiles, self.opts) + diffopts = mdiff.diffopts(git=True, nodates=True) + for s in patch.diff(self.repo, self._node1, self._node2, + match=matcher, opts=diffopts): + difflines.extend(s.splitlines(True))   try: - difftext = [] - if len(files) != 0: - wfiles = [self.repo.wjoin(x) for x in files] - matcher = cmdutil.match(self.repo, wfiles, self.opts) - diffopts = mdiff.diffopts(git=True, nodates=True) - for s in patch.diff(self.repo, self._node1, self._node2, - match=matcher, opts=diffopts): - difftext.extend(s.splitlines(True)) - difftext = cStringIO.StringIO(''.join(difftext)) + difftext = cStringIO.StringIO(''.join(difflines))   difftext.seek(0)     self._shelve_chunks = hgshelve.parsepatch(difftext)