--- a/mercurial/localrepo.py Tue Dec 05 11:23:37 2006 +0100
+++ b/mercurial/localrepo.py Tue Dec 05 11:28:21 2006 +0100
@@ -483,9 +483,11 @@
ds = ""
self.opener("journal.dirstate", "w").write(ds)
+ renames = [(self.sjoin("journal"), self.sjoin("undo")),
+ (self.join("journal.dirstate"), self.join("undo.dirstate"))]
tr = transaction.transaction(self.ui.warn, self.sopener,
self.sjoin("journal"),
- aftertrans(self.path))
+ aftertrans(renames))
self.transhandle = tr
return tr
@@ -1897,12 +1899,11 @@
return self.pull(remote, heads)
# used to avoid circular references so destructors work
-def aftertrans(base):
- p = base
+def aftertrans(files):
+ renamefiles = [tuple(t) for t in files]
def a():
- util.rename(os.path.join(p, "journal"), os.path.join(p, "undo"))
- util.rename(os.path.join(p, "journal.dirstate"),
- os.path.join(p, "undo.dirstate"))
+ for src, dest in renamefiles:
+ util.rename(src, dest)
return a
def instance(ui, path, create):