mirror of
https://github.com/facebook/sapling.git
synced 2025-01-06 04:43:19 +03:00
Make undo and recover friendlier
Add them to the help display, have them report failure
This commit is contained in:
parent
683f21be6a
commit
f86593199d
4
hg
4
hg
@ -36,10 +36,12 @@ def help():
|
||||
init create a new repository in this directory
|
||||
log <file> show revision history of a single file
|
||||
merge <path> merge changes from <path> 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 @@ elif cmd == "tags":
|
||||
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":
|
||||
|
@ -300,7 +300,10 @@ class localrepository:
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user