[PATCH 01 of 13] Print relative names in the purge extension

Emanuele Aina faina.mail at tiscali.it
Tue Feb 27 07:06:01 UTC 2007


# HG changeset patch
# User Emanuele Aina <em at nerd.ocracy.org>
# Date 1172563536 -3600
# Node ID aa4aa482615f6cece71ce4530cb1824a34736510
# Parent  d5011e347476fb77ab4d7c31d21c239b4f83f879
Print relative names in the purge extension

diff --git a/contrib/purge/purge.py b/contrib/purge/purge.py
--- a/contrib/purge/purge.py
+++ b/contrib/purge/purge.py
@@ -70,24 +70,25 @@ class Purge(object):
         # directory.
         if self._repo.dirstate.state(relative_name) != '?':
             return
-        self._ui.note(_('Removing file %s\n') % name)
+        self._ui.note(_('Removing file %s\n') % relative_name)
         if self._act:
             try:
                 os.remove(name)
             except OSError, e:
-                self._error(_('%s cannot be removed') % name)
+                self._error(_('%s cannot be removed') % relative_name)
         else:
-            self._ui.write('%s%s' % (name, self._eol))
+            self._ui.write('%s%s' % (relative_name, self._eol))
 
     def _remove_dir(self, name):
-        self._ui.note(_('Removing directory %s\n') % name)
+        relative_name = self._relative_name(name)
+        self._ui.note(_('Removing directory %s\n') % relative_name)
         if self._act:
             try:
                 os.rmdir(name)
             except OSError, e:
-                self._error(_('%s cannot be removed') % name)
+                self._error(_('%s cannot be removed') % relative_name)
         else:
-            self._ui.write('%s%s' % (name, self._eol))
+            self._ui.write('%s%s' % (relative_name, self._eol))
 
     def _relative_name(self, path):
         '''



More information about the Mercurial-devel mailing list