Fix hg import --exact bug that hangs hg on failure.
--- a/mercurial/commands.py Sun May 13 19:15:54 2007 -0700
+++ b/mercurial/commands.py Thu May 17 09:29:30 2007 -0700
@@ -1565,7 +1565,7 @@
n = repo.commit(files, message, user, date, wlock=wlock, lock=lock)
if opts.get('exact'):
if hex(n) != nodeid:
- repo.rollback()
+ repo.rollback(wlock=wlock, lock=lock)
raise util.Abort(_('patch is damaged or loses information'))
finally:
os.unlink(tmpname)
--- a/mercurial/localrepo.py Sun May 13 19:15:54 2007 -0700
+++ b/mercurial/localrepo.py Thu May 17 09:29:30 2007 -0700
@@ -586,10 +586,11 @@
self.ui.warn(_("no interrupted transaction available\n"))
return False
- def rollback(self, wlock=None):
+ def rollback(self, wlock=None, lock=None):
if not wlock:
wlock = self.wlock()
- l = self.lock()
+ if not lock:
+ lock = self.lock()
if os.path.exists(self.sjoin("undo")):
self.ui.status(_("rolling back last transaction\n"))
transaction.rollback(self.sopener, self.sjoin("undo"))