Package: tailor
Version: 0.9.28-1
Severity: important
Tags: patch

I encountered the following errors while making a CVS->Mercurial sync.

Traceback (most recent call last):
  File "/var/lib/python-support/python2.4/vcpx/source.py", line 141, in 
applyPendingChangesets
    replay(c)
  File "/var/lib/python-support/python2.4/vcpx/dualwd.py", line 107, in 
replayChangeset
    self.target.replayChangeset(changeset)
  File "/var/lib/python-support/python2.4/vcpx/target.py", line 126, in 
replayChangeset
    entries, tags = changeset.tags)
  File "/var/lib/python-support/python2.4/vcpx/repository/hg.py", line 294, in 
_commit
    self._hgCommand('commit', **opts)
  File "/var/lib/python-support/python2.4/vcpx/repository/hg.py", line 339, in 
_hgCommand
    allopts = self._defaultOpts(cmd)
  File "/var/lib/python-support/python2.4/vcpx/repository/hg.py", line 333, in 
_defaultOpts
    findcmd = commands.find
AttributeError: 'module' object has no attribute 'find'
16:36:59 [C] Upstream change application failed
Traceback (most recent call last):
  File "/usr/bin/tailor", line 35, in ?
    main()
  File "/var/lib/python-support/python2.4/vcpx/tailor.py", line 339, in main
    tailorizer()
  File "/var/lib/python-support/python2.4/vcpx/tailor.py", line 147, in __call__
    self.update()
  File "/var/lib/python-support/python2.4/vcpx/tailor.py", line 110, in update
    last, conflicts = dwd.applyPendingChangesets(
  File "/var/lib/python-support/python2.4/vcpx/dualwd.py", line 97, in 
applyPendingChangesets
    applied=applied)
  File "/var/lib/python-support/python2.4/vcpx/source.py", line 141, in 
applyPendingChangesets
    replay(c)
  File "/var/lib/python-support/python2.4/vcpx/dualwd.py", line 107, in 
replayChangeset
    self.target.replayChangeset(changeset)
  File "/var/lib/python-support/python2.4/vcpx/target.py", line 126, in 
replayChangeset
    entries, tags = changeset.tags)
  File "/var/lib/python-support/python2.4/vcpx/repository/hg.py", line 294, in 
_commit
    self._hgCommand('commit', **opts)
  File "/var/lib/python-support/python2.4/vcpx/repository/hg.py", line 339, in 
_hgCommand
    allopts = self._defaultOpts(cmd)
  File "/var/lib/python-support/python2.4/vcpx/repository/hg.py", line 333, in 
_defaultOpts
    findcmd = commands.find
AttributeError: 'module' object has no attribute 'find'

The mercurial.commands module does not have a find or findcmd function,
but mercurial.cmdutil does, (perhaps it was moved?). I have mercurial
0.9.4-1 installed.

The attached patch works for me.

Regards,


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (700, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-4-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages tailor depends on:
ii  python                        2.4.4-6    An interactive high-level object-o
ii  python-support                0.6.4      automated rebuilding support for p

Versions of packages tailor recommends:
ii  rsync                         2.6.9-3    fast remote file copy program (lik

-- no debconf information

-- 
Eric Evans
[EMAIL PROTECTED]
--- vcpx/repository/hg.py	2007-04-25 12:31:38.000000000 -0500
+++ vcpx/repository/hg.py	2007-07-09 16:43:50.000000000 -0500
@@ -13,7 +13,7 @@
 
 __docformat__ = 'reStructuredText'
 
-from mercurial import ui, hg, commands
+from mercurial import ui, hg, commands, cmdutil
 
 from vcpx.repository import Repository
 from vcpx.source import UpdatableSourceWorkingDir
@@ -323,14 +323,14 @@
     def _defaultOpts(self, cmd):
         # Not sure this is public. commands.parse might be, but this
         # is easier, and while dispatch is easiest, you lose ui.
-        if hasattr(commands, 'findcmd'):
-            if commands.findcmd.func_code.co_argcount == 1:
-                findcmd = commands.findcmd
+        if hasattr(cmdutil, 'findcmd'):
+            if cmdutil.findcmd.func_code.co_argcount == 1:
+                findcmd = cmdutil.findcmd
             else:
                 def findcmd(cmd):
-                    return commands.findcmd(self._getUI(), cmd)
+                    return cmdutil.findcmd(self._getUI(), cmd)
         else:
-            findcmd = commands.find
+            findcmd = cmdutil.find
         return dict([(f[1].replace('-', '_'), f[2]) for f in findcmd(cmd)[1][1]])
 
     def _hgCommand(self, cmd, *args, **opts):

Attachment: signature.asc
Description: Digital signature

Reply via email to