tailor 0.9.35-2 (ubuntu jaunty)

Völgyes Dávid david.volgyes at gmail.com
Thu Aug 27 13:00:54 BST 2009


Hi,

I use Ubuntu Jaunty 9.04 and tailor 0.9.35-2 application

I have found a bug and I think I have a solution.
I tried to convert a monotone repository to svn repository.
I got this:

10:58:35 [C] Upstream change application failed
10:58:35 [C] Something unexpected!
Traceback (most recent call last):
  File "/var/lib/python-support/python2.6/vcpx/tailor.py", line 154, in __call__
    self.update()
  File "/var/lib/python-support/python2.6/vcpx/tailor.py", line 118, in update
    applyable=self._applyable, applied=self._applied)
  File "/var/lib/python-support/python2.6/vcpx/dualwd.py", line 102,
in applyPendingChangesets
    applied=applied)
  File "/var/lib/python-support/python2.6/vcpx/source.py", line 113,
in applyPendingChangesets
    res = self._applyChangeset(c)
  File "/var/lib/python-support/python2.6/vcpx/repository/monotone.py",
line 818, in _applyChangeset
    mtr.updateCset( changeset )
  File "/var/lib/python-support/python2.6/vcpx/repository/monotone.py",
line 689, in updateCset
    self.diffparser.convertDiff(chset)
  File "/var/lib/python-support/python2.6/vcpx/repository/monotone.py",
line 540, in convertDiff
    if chentry == None:
  File "/var/lib/python-support/python2.6/vcpx/changes.py", line 65, in __eq__
    return (self.name == other.name and
AttributeError: 'NoneType' object has no attribute 'name'

As you can see: "other" is nonetype. You should check type of "other"
in /var/lib/python-support/python2.6/vcpx/changes.py.
I have made a patch. (diff: original ( changes.py ) and the fixed file
( /var/lib/python-support/python2.6/vcpx/changes.py ) ):

--- changes.py  2009-08-27 13:35:04.773749252 +0200
+++ /var/lib/python-support/python2.6/vcpx/changes.py   2009-08-27
11:50:35.000000000 +0200
@@ -5,6 +5,8 @@
 # :Licenza:  GNU General Public License
 #

+from types import *
+
 """
 Changesets are an object representation of a set of changes to some
files.
 """
@@ -62,14 +64,16 @@
         return s

     def __eq__(self, other):
-        return (self.name == other.name and
+        return (type(other) != NoneType and
+                self.name == other.name and
                 self.old_name == other.old_name and
                 self.old_revision == other.old_revision and
                 self.new_revision == other.new_revision and
                 self.action_kind == other.action_kind)

     def __ne__(self, other):
-        return (self.name != other.name or
+        return (type(other) == NoneType or
+                self.name != other.name or
                 self.old_name != other.old_name or
                 self.old_revision != other.old_revision or
                 self.new_revision != other.new_revision or


This is not a perfect solution but works. (I don't know why was
"other" NoneType.
Possibly there is another bug somewhere in the code.)

I have attached the original file (original.py), the patched file
(patched.py), and the diff (diff.txt)

If you have any question, please, let me know.

David Volgyes
-------------- next part --------------
--- original.py	2009-08-27 13:35:04.773749252 +0200
+++ patched.py	2009-08-27 13:53:17.693750682 +0200
@@ -5,6 +5,8 @@
 # :Licenza:  GNU General Public License
 #
 
+from types import *
+
 """
 Changesets are an object representation of a set of changes to some files.
 """
@@ -62,14 +64,16 @@
         return s
 
     def __eq__(self, other):
-        return (self.name == other.name and
+        return (type(other) != NoneType and
+                self.name == other.name and
                 self.old_name == other.old_name and
                 self.old_revision == other.old_revision and
                 self.new_revision == other.new_revision and
                 self.action_kind == other.action_kind)
 
     def __ne__(self, other):
-        return (self.name != other.name or
+        return (type(other) == NoneType or
+                self.name != other.name or 
                 self.old_name != other.old_name or
                 self.old_revision != other.old_revision or
                 self.new_revision != other.new_revision or
-------------- next part --------------
A non-text attachment was scrubbed...
Name: original.py
Type: text/x-python
Size: 7954 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/ubuntu-motu/attachments/20090827/cebe2cc2/attachment.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patched.py
Type: text/x-python
Size: 8063 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/ubuntu-motu/attachments/20090827/cebe2cc2/attachment-0001.py 


More information about the Ubuntu-motu mailing list