Renaming a branch from inside the branch crashes bzr

Bug #350929 reported by Daniel P.
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

From inside the current directory, I was trying to rename the branch (this was the highest-level directory in the branch). It crashed bzr. I can live with bzr not able to rename it, but it shouldn't crash.

   mypath$ bzr mv .. HFSP

gives the following error

bzr: ERROR: exceptions.IndexError: list index out of range

Traceback (most recent call last):
  File "/home/polani/lib/python/bzrlib/commands.py", line 896, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/polani/lib/python/bzrlib/commands.py", line 842, in run_bzr
    ret = run(*run_argv)
  File "/home/polani/lib/python/bzrlib/commands.py", line 542, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/polani/lib/python/bzrlib/builtins.py", line 684, in run
    self._run(tree, names_list, rel_names, after)
  File "/home/polani/lib/python/bzrlib/builtins.py", line 763, in _run
    tree.rename_one(src, dest, after=after)
  File "/home/polani/lib/python/bzrlib/mutabletree.py", line 52, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/home/polani/lib/python/bzrlib/workingtree_4.py", line 1252, in rename_one
    WorkingTree.rename_one(self, from_rel, to_rel, after)
  File "/home/polani/lib/python/bzrlib/mutabletree.py", line 52, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/home/polani/lib/python/bzrlib/workingtree.py", line 1433, in rename_one
    from_tail = splitpath(from_rel)[-1]
IndexError: list index out of range

bzr 1.12 on python 2.5.1 (linux2)
arguments: ['/home/polani/bin/bzr', 'mv', '..', 'HFSP']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_GB.UTF-8'
plugins:
  launchpad /home/polani/lib/python/bzrlib/plugins/launchpad [unknown]
  netrc_credential_store /home/polani/lib/python/bzrlib/plugins/netrc_credential_store [unknown]
  svn /home/polani/.bazaar/plugins/svn [0.5.2]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.

Revision history for this message
Marius Kruger (amanica) wrote :
Download full text (10.4 KiB)

I can reproduce it with more or less the following:

bzr init /tmp/branch
cd /tmp/branch

bzr mv .. HFSP
bzr: ERROR: Not a branch: "/tmp/".

 bzr mv . HFSP
bzr: ERROR: exceptions.IndexError: list index out of range

Traceback (most recent call last):
  File "/stuph/projects/bzr/bzr.repo/bzr.dev/bzrlib/commands.py", line 727, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/stuph/projects/bzr/bzr.repo/bzr.dev/bzrlib/commands.py", line 922, in run_bzr
    ret = run(*run_argv)
  File "/stuph/projects/bzr/bzr.repo/bzr.dev/bzrlib/commands.py", line 559, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/stuph/projects/bzr/bzr.repo/bzr.dev/bzrlib/builtins.py", line 743, in run
    self._run(tree, names_list, rel_names, after)
  File "/stuph/projects/bzr/bzr.repo/bzr.dev/bzrlib/builtins.py", line 836, in _run
    tree.rename_one(src, dest, after=after)
  File "/stuph/projects/bzr/bzr.repo/bzr.dev/bzrlib/mutabletree.py", line 52, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/stuph/projects/bzr/bzr.repo/bzr.dev/bzrlib/workingtree_4.py", line 1266, in rename_one
    WorkingTree.rename_one(self, from_rel, to_rel, after)
  File "/stuph/projects/bzr/bzr.repo/bzr.dev/bzrlib/mutabletree.py", line 52, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/stuph/projects/bzr/bzr.repo/bzr.dev/bzrlib/workingtree.py", line 1462, in rename_one
    from_tail = splitpath(from_rel)[-1]
IndexError: list index out of range

bzr 1.14dev on python 2.5.2 (linux2)
arguments: ['/stuph/bin/bzr', 'mv', '.', 'HFSP']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_ZA.UTF-8'
plugins:
  authors /home/amanica/.bazaar/plugins/authors [unknown]
  bisect /home/amanica/.bazaar/plugins/bisect [1.1.0.pre.0]
  bookmarks /home/amanica/.bazaar/plugins/bookmarks [unknown]
  bzr_push_and_update /home/amanica/.bazaar/plugins/bzr_push_and_update [0.2dev]
  bzrtools /home/amanica/.bazaar/plugins/bzrtools [1.13]
  difftools /home/amanica/.bazaar/plugins/difftools [unknown]
  docdiff /home/amanica/.bazaar/plugins/docdiff [0.9]
  email /home/amanica/.bazaar/plugins/email [unknown]
  extcomman...

Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Jelmer Vernooij (jelmer)
tags: added: mv
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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