##// END OF EJS Templates
localrepo: change aftertrans to be independant of the store path
Benoit Boissinot -
r3790:f183c185 default
parent child Browse files
Show More
@@ -483,9 +483,11 b' class localrepository(repo.repository):'
483 ds = ""
483 ds = ""
484 self.opener("journal.dirstate", "w").write(ds)
484 self.opener("journal.dirstate", "w").write(ds)
485
485
486 renames = [(self.sjoin("journal"), self.sjoin("undo")),
487 (self.join("journal.dirstate"), self.join("undo.dirstate"))]
486 tr = transaction.transaction(self.ui.warn, self.sopener,
488 tr = transaction.transaction(self.ui.warn, self.sopener,
487 self.sjoin("journal"),
489 self.sjoin("journal"),
488 aftertrans(self.path))
490 aftertrans(renames))
489 self.transhandle = tr
491 self.transhandle = tr
490 return tr
492 return tr
491
493
@@ -1897,12 +1899,11 b' class localrepository(repo.repository):'
1897 return self.pull(remote, heads)
1899 return self.pull(remote, heads)
1898
1900
1899 # used to avoid circular references so destructors work
1901 # used to avoid circular references so destructors work
1900 def aftertrans(base):
1902 def aftertrans(files):
1901 p = base
1903 renamefiles = [tuple(t) for t in files]
1902 def a():
1904 def a():
1903 util.rename(os.path.join(p, "journal"), os.path.join(p, "undo"))
1905 for src, dest in renamefiles:
1904 util.rename(os.path.join(p, "journal.dirstate"),
1906 util.rename(src, dest)
1905 os.path.join(p, "undo.dirstate"))
1906 return a
1907 return a
1907
1908
1908 def instance(ui, path, create):
1909 def instance(ui, path, create):
General Comments 0
You need to be logged in to leave comments. Login now