Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.1, 1.1.1, and 1.1.2

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

Changeset 049019fdd430

Parent 159972a055a3

by Adrian Buehlmann

Changes to one file · Browse files at 049019fdd430 Showing diff from parent 159972a055a3 Diff from another changeset...

 
916
917
918
 
 
 
 
 
 
 
 
 
 
 
 
 
919
920
921
 
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
 
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
 
981
982
983
 
 
 
 
 
 
 
 
 
 
 
 
984
985
986
@@ -916,6 +916,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 = [] @@ -968,18 +981,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!