resolve --take-other produces AttributeError

Bug #646961 reported by Glen Mailer
38
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Vincent Ladeuil
2.2
Fix Released
High
Vincent Ladeuil
bzr (Ubuntu)
Fix Released
Undecided
Vincent Ladeuil
Maverick
Fix Released
Undecided
Unassigned

Bug Description

Exact console output follows:

Last login: Fri Sep 24 13:42:37 on ttys003
~>bzr version -v
Bazaar (bzr) 2.2.0
  Python interpreter: /usr/bin/python 2.6.1
  Python standard library: /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
  Platform: Darwin-10.4.1-i386-64bit
  bzrlib: /Library/Python/2.6/site-packages/bzrlib
  Bazaar configuration: /Users/glen/.bazaar
  Bazaar log file: /Users/glen/.bzr.log

Copyright 2005-2010 Canonical Ltd.
http://bazaar.canonical.com/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Bazaar is part of the GNU Project to produce a free operating system.

~>bzr init tmp
Created a standalone tree (format: 2a)
~>cd tmp
~/tmp>touch file1
~/tmp>bzr add
adding file1
~/tmp>bzr ci -m "stuff"
Committing to: /Users/glen/tmp/
added file1
Committed revision 1.
~/tmp>cd ..
~>bzr branch tmp tmp2
Branched 1 revision(s).
~>cd tmp
~/tmp>echo "1" >> file1
~/tmp>bzr ci -m "branch 1"
Committing to: /Users/glen/tmp/
modified file1
Committed revision 2.
~/tmp>cd ..
~>cd tmp2
~/tmp2>echo "2" >> file1
~/tmp2>bzr ci -m "branch 2"
Committing to: /Users/glen/tmp2/
modified file1
Committed revision 2.
~/tmp2>cd ../tmp
~/tmp>bzr merge ../tmp2
 M file1
Text conflict in file1
1 conflicts encountered.
~/tmp>bzr resolve file1 --take-other
bzr: ERROR: exceptions.AttributeError: 'NoneType' object has no attribute 'lower'

Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 911, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 1111, in run_bzr
    ret = run(*run_argv)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 689, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/Library/Python/2.6/site-packages/bzrlib/commands.py", line 704, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/conflicts.py", line 160, in run
    resolve(tree, file_list, action=action)
  File "/Library/Python/2.6/site-packages/bzrlib/conflicts.py", line 189, in resolve
    conflict._do(action, tree)
  File "/Library/Python/2.6/site-packages/bzrlib/conflicts.py", line 415, in _do
    meth(tree)
  File "/Library/Python/2.6/site-packages/bzrlib/conflicts.py", line 549, in action_take_other
    winner='other')
  File "/Library/Python/2.6/site-packages/bzrlib/conflicts.py", line 444, in _resolve_with_cleanups
    op.run_simple(tt, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/Library/Python/2.6/site-packages/bzrlib/conflicts.py", line 508, in _resolve
    tt.apply()
  File "/Library/Python/2.6/site-packages/bzrlib/transform.py", line 1544, in apply
    self._check_malformed()
  File "/Library/Python/2.6/site-packages/bzrlib/transform.py", line 510, in _check_malformed
    conflicts = self.find_conflicts()
  File "/Library/Python/2.6/site-packages/bzrlib/transform.py", line 501, in find_conflicts
    conflicts.extend(self._duplicate_entries(by_parent))
  File "/Library/Python/2.6/site-packages/bzrlib/transform.py", line 650, in _duplicate_entries
    name_ids = [(n.lower(), t) for n, t in name_ids]
AttributeError: 'NoneType' object has no attribute 'lower'

bzr 2.2.0 on python 2.6.1 (Darwin-10.4.1-i386-64bit)
arguments: ['/usr/local/bin/bzr', 'resolve', 'file1', '--take-other']
encoding: 'UTF-8', fsenc: 'utf-8', lang: 'en_GB.UTF-8'
plugins:
  bash_completion /Library/Python/2.6/site-packages/bzrlib/plugins/bash_completion [2.2.0]
  bzrtools /Library/Python/2.6/site-packages/bzrlib/plugins/bzrtools [2.2.0]
  colo /Library/Python/2.6/site-packages/bzrlib/plugins/colo [0.1.0]
  email /Library/Python/2.6/site-packages/bzrlib/plugins/email [unknown]
  epidirs /Users/glen/.bazaar/plugins/epidirs [0.2.0dev1]
  explorer /Library/Python/2.6/site-packages/bzrlib/plugins/explorer [1.1.0dev2]
  extmerge /Library/Python/2.6/site-packages/bzrlib/plugins/extmerge [unknown]
  fastimport /Library/Python/2.6/site-packages/bzrlib/plugins/fastimport [0.9.0dev]
  gardener /Users/glen/.bazaar/plugins/gardener [unknown]
  gsdirs /Users/glen/.bazaar/plugins/gsdirs [0.1.0dev1]
  keychain /Library/Python/2.6/site-packages/bzrlib/plugins/keychain [0.1.0]
  launchpad /Library/Python/2.6/site-packages/bzrlib/plugins/launchpad [2.2.0]
  loom /Library/Python/2.6/site-packages/bzrlib/plugins/loom [2.2.1dev]
  netrc_credential_store /Library/Python/2.6/site-packages/bzrlib/plugins/netrc_credential_store [2.2.0]
  news_merge /Library/Python/2.6/site-packages/bzrlib/plugins/news_merge [2.2.0]
  pipeline /Library/Python/2.6/site-packages/bzrlib/plugins/pipeline [unknown]
  qbzr /Users/glen/.bazaar/plugins/qbzr [0.20.0dev1]
  rewrite /Library/Python/2.6/site-packages/bzrlib/plugins/rewrite [0.6.0]
  server_auth /Users/glen/.bazaar/plugins/server_auth [0.0.1dev1]
  shortcuts /Users/glen/.bazaar/plugins/shortcuts [0.0.1dev1]
  signature /Users/glen/.bazaar/plugins/signature [unknown]
  svn /Users/glen/.bazaar/plugins/svn [1.0.5dev]
  upload /Library/Python/2.6/site-packages/bzrlib/plugins/upload [1.0.0dev]
  xmloutput /Library/Python/2.6/site-packages/bzrlib/plugins/xmloutput [0.8.6]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.
~/tmp>bzr resolve file1 --take-this
~/tmp>bzr s
modified:
  file1
pending merge tips: (use -v to see all merge revisions)
  Glen Mailer 2010-09-24 branch 2
~/tmp>

Related branches

Revision history for this message
Glen Mailer (glenjamin) wrote :

This also happens with --no-plugins.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Thanks for the recipe ! I can reproduce locally.

Changed in bzr:
importance: Undecided → High
status: New → Confirmed
tags: added: conflicts
Revision history for this message
Vincent Ladeuil (vila) wrote :

--take-this and --take-other are *not* (yet) implemented for TextConflict, there is a related FIXME about the root cause of the bug here: we try to resolve the conflict as being a PathConflict which is totally not appropriate in this case :-/

Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
Vincent Ladeuil (vila)
Changed in bzr:
status: Confirmed → In Progress
Martin Packman (gz)
Changed in bzr:
milestone: none → 2.3b4
status: In Progress → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: New → Confirmed
Vincent Ladeuil (vila)
Changed in bzr (Ubuntu):
assignee: nobody → Vincent Ladeuil (vila)
status: Confirmed → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote : Please test proposed package

Accepted bzr into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in bzr (Ubuntu Maverick):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Martin Pool (mbp) wrote :

SRU Verification:

I ran the script above (thanks very much) on maverick's 2.2.0 and it failed, though not in the exact same way:

% sh 646961-repro.sh
Created a standalone tree (format: 2a)
adding file1
Committing to: /home/mbp/tmp/tmp/
added file1
Committed revision 1.
Branched 1 revision(s).
Committing to: /home/mbp/tmp/tmp/
modified file1
Committed revision 2.
Committing to: /home/mbp/tmp/tmp2/
modified file1
Committed revision 2.
 M file1
Text conflict in file1
1 conflicts encountered.
bzr: ERROR: Tree transform is malformed [('duplicate', None, 'new-1', None)]
sh 646961-repro.sh 1.13s user 0.25s system 81% cpu 1.687 total

with the SRU's 2.2.4-0ubuntu1, I get a clean error:

% sh 646961-repro.sh
Created a standalone tree (format: 2a)
adding file1
Committing to: /home/mbp/tmp/tmp/
added file1
Committed revision 1.
Branched 1 revision(s).
Committing to: /home/mbp/tmp/tmp/
modified file1
Committed revision 2.
Committing to: /home/mbp/tmp/tmp2/
modified file1
Committed revision 2.
 M file1
Text conflict in file1
1 conflicts encountered.

Per vila's comment #3, this is not completely implemented yet, but it does address the particular bug described here. Therefore, verification complete.

tags: added: verification-ok
removed: verification-needed
Martin Pool (mbp)
tags: added: verification-done
removed: verification-ok
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr - 2.2.4-0ubuntu1

---------------
bzr (2.2.4-0ubuntu1) maverick-proposed; urgency=low

  [ Jelmer Vernooij ]
  * Update watch file to use 2.2 series.
  * New upstream release.
   + Fixes closing of leaked sockets to SSH subprocesses, which causes
     dput sftp uploads to hang. LP: #659590
   + Fixes the use of 'lp:' urls behind a http proxy. LP: #558343
   + Correctly sets the Content-Type header when http POSTing to comply
     with stricter web frameworks. LP: #665100
   + Fixes propagating tags to the master branch in a bound branch or
     heavyweight checkout. LP: #603395
   + Fixes the use of 'bzr resolve --take-other' if the file is
     involved in an unresolved text conflict. LP: #646961
   + Fixes https access with newer versions of python2.7. LP: #693880
   + Fixes crash during pack caused by a concurrent repository pack
     operation. LP: #701940
   + Fixes communication with the Launchpad web service when using
     launchpadlib >= 1.5.5. LP: #707075
   + Switches away from deprecated 'edge.launchpad.net' LP: #583667
   + Fixes resolving of content (and path) conflicts for files in subdirs.
     LP: #660935
   + Fixes nasty recursion loop while displaying branch opening error.
     LP: #687653

  [ Martin Pool ]
  * Propose for maverick SRU.
 -- Martin Pool <email address hidden> Thu, 07 Apr 2011 15:30:17 +1000

Changed in bzr (Ubuntu Maverick):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.