Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.0.2, 1.0.3, and 1.0.4

stable commit: make sure finish() is in scope on exception

Changeset 807eac026265

Parent 0162d25e318e

by Adrian Buehlmann

Changes to one file · Browse files at 807eac026265 Showing diff from parent 0162d25e318e Diff from another changeset...

 
902
903
904
 
 
 
 
 
 
 
 
 
 
 
 
 
905
906
907
 
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
 
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
 
967
968
969
 
 
 
 
 
 
 
 
 
 
 
 
970
971
972
@@ -902,6 +902,19 @@
  gdialog.Prompt(_('Commit'),   _('Unable to create ') + backupdir, self).run()   return + + def finish(): + os.chdir(cwd) + # restore backup files + try: + for realname, tmpname in backups.iteritems(): + util.copyfile(tmpname, repo.wjoin(realname)) + os.unlink(tmpname) + os.rmdir(backupdir) + except OSError: + pass + callback() +   try:   # backup continues   allchunks = [] @@ -954,18 +967,6 @@
  _('Unable to apply patch'), self).run()   return   - def finish(): - os.chdir(cwd) - # restore backup files - try: - for realname, tmpname in backups.iteritems(): - util.copyfile(tmpname, repo.wjoin(realname)) - os.unlink(tmpname) - os.rmdir(backupdir) - except OSError: - pass - callback() -   # 4. We prepared working directory according to filtered patch.   # Now is the time to delegate the job to commit/qrefresh   # or the like!