Commits

Anonymous committed 2ba3a23

fixes for hg 1.3 and dos patches based on debugging

  • Participants
  • Parent commits bf3d21f

Comments (0)

Files changed (1)

         try:
             head = repo.dirstate.parents()[0]
             # Save the open changes
-            n = repo.commit(None, 'working', 'hgattic', force=1)
+            self.ui.note(_("saving open changes\n"))
+            n = repo.commit('working', 'hgattic', None, force=1)
             savediff()
             whead = repo.heads(None)[0]
             # Set the workspace to match the base version for patching
+            self.ui.note(_("applying diff to version specified in patch\n"))
             hg.clean(repo, parent)
-            applydiff(patchfile)
-            n = repo.commit(None, 'patched', 'hgattic', force=1)
+            applydiff(self.join(patchfile))
+            n = repo.commit('patched', 'hgattic', None, force=1)
             phead = repo.heads(None)[0]
             if reverse:
                 # Merge, using the working copy to avoid conflicts
+                self.ui.note(_("applying reverse\n"))
                 hgmerge = os.environ.get('HGMERGE')
                 os.environ['HGMERGE'] = 'internal:other'
                 hg.merge(repo, whead, force=True)
                 os.environ['HGMERGE'] = hgmerge
                 # Backout the patched version, this is where we want conflicts
-                repo.commit(None, 'merge', 'hgattic', force=1)
+                repo.commit('merge', 'hgattic', None, force=1)
                 backout_opts = {'rev': phead, 'merge': True,
                                 'message': 'backout'}
                 commands.backout(self.ui, repo, **backout_opts)
             else:
                 # Merge the working copy with the patched copy
+                self.ui.note(_("merging patch forward\n"))
                 hg.merge(repo, whead, force=True)
             savediff()
             success = True
         finally:
             simplemerge.simplemerge = smo
+            self.ui.note(_("cleanup\n"))
             hg.clean(repo, head)
             strip_opts = {'backup': False, 'nobackup': True, 'force': False}
             if phead and head != phead:
                 applydiff('.saved')
             self.ui.quiet = quiet
         if success:
+            self.ui.note(_("applying updated patch\n"))
             success = self._applypatch(repo, '.saved', sim, force, **opts)
         return success
 
         except error.RepoError:
             pass
         if merge:
-            success = self._applymerge(repo, tmpname, sim, patchfile, p1,
+            success = self._applymerge(repo, patchfile, sim, patchfile, p1,
                                         force=force, **opts)
         else:
-            success = self._applypatch(repo, tmpname, sim,
+            success = self._applypatch(repo, patchfile, sim,
                                         force=force, **opts)
         os.unlink(tmpname)
         if success: