Mercurial > hg
comparison mercurial/hg.py @ 163:f38c90953c2c
Make undo and recover friendlier
Add them to the help display, have them report failure
author | mpm@selenic.com |
---|---|
date | Thu, 26 May 2005 09:48:50 -0800 |
parents | 5dcbe4d9a30c |
children | 75dddd697ed4 |
comparison
equal
deleted
inserted
replaced
162:5dcbe4d9a30c | 163:f38c90953c2c |
---|---|
298 self.join("undo")) | 298 self.join("undo")) |
299 | 299 |
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: |
307 return lock.lock(self.join("lock"), 0) | 310 return lock.lock(self.join("lock"), 0) |
308 except lock.LockHeld, inst: | 311 except lock.LockHeld, inst: |