##// END OF EJS Templates
Make undo and recover friendlier...
mpm@selenic.com -
r163:f38c9095 default
parent child Browse files
Show More
@@ -36,10 +36,12 b' def help():'
36 init create a new repository in this directory
36 init create a new repository in this directory
37 log <file> show revision history of a single file
37 log <file> show revision history of a single file
38 merge <path> merge changes from <path> into local repository
38 merge <path> merge changes from <path> into local repository
39 recover rollback an interrupted transaction
39 remove [files...] remove the given files in the next commit
40 remove [files...] remove the given files in the next commit
40 serve export the repository via HTTP
41 serve export the repository via HTTP
41 status show new, missing, and changed files in working dir
42 status show new, missing, and changed files in working dir
42 tags show current changeset tags
43 tags show current changeset tags
44 undo undo the last transaction
43 """
45 """
44
46
45 def filterfiles(list, files):
47 def filterfiles(list, files):
@@ -424,11 +426,9 b' elif cmd == "tags":'
424 print "%-30s %5d:%s" % (k, repo.changelog.rev(n), hg.hex(n))
426 print "%-30s %5d:%s" % (k, repo.changelog.rev(n), hg.hex(n))
425
427
426 elif cmd == "recover":
428 elif cmd == "recover":
427 ui.status("rolling back any existing journal")
428 repo.recover()
429 repo.recover()
429
430
430 elif cmd == "undo":
431 elif cmd == "undo":
431 ui.status("rolling back previous transaction")
432 repo.recover("undo")
432 repo.recover("undo")
433
433
434 elif cmd == "verify":
434 elif cmd == "verify":
@@ -300,7 +300,10 b' class localrepository:'
300 def recover(self, f = "journal"):
300 def recover(self, f = "journal"):
301 self.lock()
301 self.lock()
302 if os.path.exists(self.join(f)):
302 if os.path.exists(self.join(f)):
303 self.ui.status("attempting to rollback %s information\n" % f)
303 return rollback(self.opener, self.join(f))
304 return rollback(self.opener, self.join(f))
305 else:
306 self.ui.warn("no %s information available\n" % f)
304
307
305 def lock(self, wait = 1):
308 def lock(self, wait = 1):
306 try:
309 try:
General Comments 0
You need to be logged in to leave comments. Login now