Mercurial > hg
changeset 3790:f183c18568df
localrepo: change aftertrans to be independant of the store path
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Tue, 05 Dec 2006 11:28:21 +0100 |
parents | 734b1d6ba3dc |
children | 8643b9f90b51 |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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):