revlog: stop exporting node.short
authorMatt Mackall <mpm@selenic.com>
Sat, 21 May 2011 15:01:28 -0500
changeset 14393 bdf44e63a94c
parent 14392 bb5cbc16349e
child 14394 5b98d7416a32
revlog: stop exporting node.short
hgext/transplant.py
mercurial/revlog.py
tests/test-check-pyflakes.t
--- a/hgext/transplant.py	Thu May 19 22:55:13 2011 +0200
+++ b/hgext/transplant.py	Sat May 21 15:01:28 2011 -0500
@@ -15,6 +15,7 @@
 
 from mercurial.i18n import _
 import os, tempfile
+from mercurial.node import short
 from mercurial import bundlerepo, hg, merge, match
 from mercurial import patch, revlog, scmutil, util, error, cmdutil
 from mercurial import revset, templatekw
@@ -110,7 +111,7 @@
             lock = repo.lock()
             for rev in revs:
                 node = revmap[rev]
-                revstr = '%s:%s' % (rev, revlog.short(node))
+                revstr = '%s:%s' % (rev, short(node))
 
                 if self.applied(repo, node, p1):
                     self.ui.warn(_('skipping already applied revision %s\n') %
@@ -143,7 +144,7 @@
 
                 if parents[1] != revlog.nullid:
                     self.ui.note(_('skipping merge changeset %s:%s\n')
-                                 % (rev, revlog.short(node)))
+                                 % (rev, short(node)))
                     patchfile = None
                 else:
                     fd, patchfile = tempfile.mkstemp(prefix='hg-transplant-')
@@ -163,11 +164,11 @@
                                           filter=opts.get('filter'))
                         if n and domerge:
                             self.ui.status(_('%s merged at %s\n') % (revstr,
-                                      revlog.short(n)))
+                                      short(n)))
                         elif n:
                             self.ui.status(_('%s transplanted to %s\n')
-                                           % (revlog.short(node),
-                                              revlog.short(n)))
+                                           % (short(node),
+                                              short(n)))
                     finally:
                         if patchfile:
                             os.unlink(patchfile)
@@ -219,7 +220,7 @@
             # we don't translate messages inserted into commits
             message += '\n(transplanted from %s)' % revlog.hex(node)
 
-        self.ui.status(_('applying %s\n') % revlog.short(node))
+        self.ui.status(_('applying %s\n') % short(node))
         self.ui.note('%s %s\n%s\n' % (user, date, message))
 
         if not patchfile and not merge:
@@ -270,8 +271,8 @@
         '''recover last transaction and apply remaining changesets'''
         if os.path.exists(os.path.join(self.path, 'journal')):
             n, node = self.recover(repo)
-            self.ui.status(_('%s transplanted as %s\n') % (revlog.short(node),
-                                                           revlog.short(n)))
+            self.ui.status(_('%s transplanted as %s\n') % (short(node),
+                                                           short(n)))
         seriespath = os.path.join(self.path, 'series')
         if not os.path.exists(seriespath):
             self.transplants.write()
--- a/mercurial/revlog.py	Thu May 19 22:55:13 2011 +0200
+++ b/mercurial/revlog.py	Sat May 21 15:01:28 2011 -0500
@@ -12,7 +12,7 @@
 """
 
 # import stuff from node for others to import from revlog
-from node import bin, hex, nullid, nullrev, short #@UnusedImport
+from node import bin, hex, nullid, nullrev
 from i18n import _
 import ancestor, mdiff, parsers, error, util, dagutil
 import struct, zlib, errno
--- a/tests/test-check-pyflakes.t	Thu May 19 22:55:13 2011 +0200
+++ b/tests/test-check-pyflakes.t	Sat May 21 15:01:28 2011 -0500
@@ -6,7 +6,6 @@
   mercurial/commands.py:*: 'bdiff' imported but unused (glob)
   mercurial/commands.py:*: 'mpatch' imported but unused (glob)
   mercurial/commands.py:*: 'osutil' imported but unused (glob)
-  mercurial/revlog.py:*: 'short' imported but unused (glob)
   hgext/inotify/linux/__init__.py:*: 'from _inotify import *' used; unable to detect undefined names (glob)
   mercurial/util.py:*: 'from posix import *' used; unable to detect undefined names (glob)
   mercurial/windows.py:*: 'from win32 import *' used; unable to detect undefined names (glob)