diff hg @ 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 be7103467d2e
children f38c90953c2c
line wrap: on
line diff
--- a/hg	Thu May 26 08:53:04 2005 -0800
+++ b/hg	Thu May 26 09:04:54 2005 -0800
@@ -423,6 +423,14 @@
             r = "?"
         print "%-30s %5d:%s" % (k, repo.changelog.rev(n), hg.hex(n))
 
+elif cmd == "recover":
+    ui.status("rolling back any existing journal")
+    repo.recover()
+
+elif cmd == "undo":
+    ui.status("rolling back previous transaction")
+    repo.recover("undo")
+
 elif cmd == "verify":
     filelinkrevs = {}
     filenodes = {}