Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hg.py @ 162:5dcbe4d9a30c
Implement recover and undo commands
This adds an interface to transaction to rollback with a given journal file
and commands to rollback an existing .hg/journal or .hg/undo.
author | mpm@selenic.com |
---|---|
date | Thu, 26 May 2005 09:04:54 -0800 |
parents | 0b4c5cb953d9 |
children | f38c90953c2c |
line wrap: on
line diff
--- a/mercurial/hg.py Thu May 26 08:53:04 2005 -0800 +++ b/mercurial/hg.py Thu May 26 09:04:54 2005 -0800 @@ -297,6 +297,11 @@ return transaction(self.opener, self.join("journal"), self.join("undo")) + def recover(self, f = "journal"): + self.lock() + if os.path.exists(self.join(f)): + return rollback(self.opener, self.join(f)) + def lock(self, wait = 1): try: return lock.lock(self.join("lock"), 0)