Print relative names in the purge extension
authorEmanuele Aina <em@nerd.ocracy.org>
Tue, 27 Feb 2007 09:05:36 +0100
changeset 4120 f9dc36b1bdd5
parent 4119 0c8a783dd197
child 4121 d250076824e3
Print relative names in the purge extension
contrib/purge/purge.py
--- a/contrib/purge/purge.py	Tue Feb 27 16:48:17 2007 -0600
+++ b/contrib/purge/purge.py	Tue Feb 27 09:05:36 2007 +0100
@@ -70,24 +70,25 @@
         # 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):
         '''