ValueError: WorkingTree.set_root_id with fileid=None when merging into empty branch

Bug #242175 reported by Daniel Clemente
42
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Jonathan Riddell

Bug Description

At the moment it's not possible to merge a repository into an empty branch. See bug 82555 for that.

This bug is not about changing this, but just about showing an error message instead of failing when that condition happens.

Reproduce it:

rm -rf bzr05 bzr06 ;
mkdir bzr05; cd bzr05; bzr init; echo pat>ata; bzr add ata; bzr commit -m "simple"; cd ..;
mkdir bzr06; cd bzr06; bzr init; bzr merge ../bzr05; bzr update; cd ..

Output (with bzr from today):

added ata
Committing to: /n/bzr05/
added ata
Committed revision 1.
+N ata
All changes applied successfully.
-D ata
All changes applied successfully.
bzr: ERROR: Reserved revision-id {null:}

Instead of „ERROR: Reserved revision-id {null:}“, I expected something like „ERROR: merging into empty branch. Try "pull" instead.“ or something helpful to the user.

Tags: easy ui
James Westby (james-w)
Changed in bzr:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Andrew Bennetts (spiv) wrote :

I'm nudging up the importance; this bit someone on the IRC channel.

Changed in bzr:
importance: Wishlist → Low
Revision history for this message
Andrew Bennetts (spiv) wrote :

FWIW, the current error worse: you get a traceback:

bzr: ERROR: exceptions.ValueError: WorkingTree.set_root_id with fileid=None

Traceback (most recent call last):
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 923, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 1123, in run_bzr
    ret = run(*run_argv)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 688, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 710, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/builtins.py", line 1494, in run
    show_base=show_base)
  File "/home/andrew/code/bzr/bzrlib/workingtree.py", line 2308, in update
    return self._update_tree(old_tip, change_reporter, revision, show_base)
  File "/home/andrew/code/bzr/bzrlib/mutabletree.py", line 49, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/workingtree.py", line 2365, in _update_tree
    self.set_root_id(to_root_id)
  File "/home/andrew/code/bzr/bzrlib/mutabletree.py", line 49, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/workingtree.py", line 2221, in set_root_id
    'WorkingTree.set_root_id with fileid=None')
ValueError: WorkingTree.set_root_id with fileid=None

Tracebacks are bad, bumping this up to High.

Changed in bzr:
importance: Low → High
Revision history for this message
Andrew Bennetts (spiv) wrote :

Possibly related: bug 522740, bug 308562.

Jonathan Riddell (jr)
Changed in bzr:
assignee: nobody → Jonathan Riddell (jr)
Jonathan Riddell (jr)
Changed in bzr:
status: Confirmed → In Progress
Jonathan Riddell (jr)
Changed in bzr:
status: In Progress → Fix Committed
Jonathan Riddell (jr)
Changed in bzr:
status: Fix Committed → Fix Released
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.4b3
Martin Pool (mbp)
summary: - Better error message when merging into empty branch
+ ValueError: WorkingTree.set_root_id with fileid=None when merging into
+ empty branch
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.