# HG changeset patch # User mpm@selenic.com # Date 1117129730 28800 # Node ID f38c90953c2c48eaebe82226167aa86b3106a4b9 # Parent 5dcbe4d9a30c4e5561d34f9d9738df3322384d6d Make undo and recover friendlier Add them to the help display, have them report failure diff -r 5dcbe4d9a30c -r f38c90953c2c hg --- a/hg Thu May 26 09:04:54 2005 -0800 +++ b/hg Thu May 26 09:48:50 2005 -0800 @@ -36,10 +36,12 @@ init create a new repository in this directory log show revision history of a single file merge merge changes from into local repository + recover rollback an interrupted transaction remove [files...] remove the given files in the next commit serve export the repository via HTTP status show new, missing, and changed files in working dir tags show current changeset tags + undo undo the last transaction """ def filterfiles(list, files): @@ -424,11 +426,9 @@ 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": diff -r 5dcbe4d9a30c -r f38c90953c2c mercurial/hg.py --- a/mercurial/hg.py Thu May 26 09:04:54 2005 -0800 +++ b/mercurial/hg.py Thu May 26 09:48:50 2005 -0800 @@ -300,7 +300,10 @@ def recover(self, f = "journal"): self.lock() if os.path.exists(self.join(f)): + self.ui.status("attempting to rollback %s information\n" % f) return rollback(self.opener, self.join(f)) + else: + self.ui.warn("no %s information available\n" % f) def lock(self, wait = 1): try: