deprecated undo -> talk about rollback
Thomas Arendsen Hein
thomas at intevation.de
Thu Jun 1 12:12:57 CDT 2006
Hi!
I pushed the following patch to crew. The last traces of undo
(except the deprecated commands.undo() itself) are the files inside
the .hg directory: .hg/undo and .hg/undo.dirstate
Should they be renamed, too?
If yes, I don't think that there should be compatibility code which
can read both ".hg/rollback" and ".hg/undo" files. Maybe only a
hint in the upgrading documentation or release announcement.
Thomas
# HG changeset patch
# User Thomas Arendsen Hein <thomas at intevation.de>
# Date 1149181709 -7200
# Node ID 482d3fb47d80693f929101f95944bf019009dd79
# Parent d3adb454c5a9655e147fa1853fd77184ffcb42c6
Renamed localrepo.undo() to rollback() and talk about "rollback information".
diff -r d3adb454c5a9 -r 482d3fb47d80 mercurial/commands.py
--- a/mercurial/commands.py Thu Jun 01 18:36:32 2006 +0200
+++ b/mercurial/commands.py Thu Jun 01 19:08:29 2006 +0200
@@ -2432,7 +2432,7 @@ def rollback(ui, repo):
repository; for example an in-progress pull from the repository
may fail if a rollback is performed.
"""
- repo.undo()
+ repo.rollback()
def root(ui, repo):
"""print the root (top) of the current working dir
@@ -2757,7 +2757,7 @@ def undo(ui, repo):
instructions, see the rollback command.
"""
ui.warn(_('(the undo command is deprecated; use rollback instead)\n'))
- repo.undo()
+ repo.rollback()
def update(ui, repo, node=None, merge=False, clean=False, force=None,
branch=None, **opts):
diff -r d3adb454c5a9 -r 482d3fb47d80 mercurial/localrepo.py
--- a/mercurial/localrepo.py Thu Jun 01 18:36:32 2006 +0200
+++ b/mercurial/localrepo.py Thu Jun 01 19:08:29 2006 +0200
@@ -303,7 +303,7 @@ class localrepository(object):
if tr != None and tr.running():
return tr.nest()
- # save dirstate for undo
+ # save dirstate for rollback
try:
ds = self.opener("dirstate").read()
except IOError:
@@ -327,7 +327,7 @@ class localrepository(object):
self.ui.warn(_("no interrupted transaction available\n"))
return False
- def undo(self, wlock=None):
+ def rollback(self, wlock=None):
if not wlock:
wlock = self.wlock()
l = self.lock()
@@ -338,7 +338,7 @@ class localrepository(object):
self.reload()
self.wreload()
else:
- self.ui.warn(_("no undo information available\n"))
+ self.ui.warn(_("no rollback information available\n"))
def wreload(self):
self.dirstate.read()
--
Email: thomas at intevation.de
http://intevation.de/~thomas/
More information about the Mercurial
mailing list