tags:

views:

25

answers:

2

When I have a history

-rev 100, merge
-- rev 95.3
-- rev 95.2
-- rev 95.1
-rev 99
-rev 98

and I try bzr uncommit -r 95.3.. it writes an error message. How can I fix the problem?

Error is

bzr: ERROR: exceptions.TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 3694, in run
local=local)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 3717, in _run
revno = revision[0].in_history(b).revno + 1
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

bzr 1.5 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'uncommit', '-r', '11955.2.32..']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'pl_PL.UTF-8'
plugins:
  bzrtools             /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.5.0]
  gtk                  /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.94.0]
  interactive          /home/adi/.bazaar/plugins/interactive [1.2.0]
  launchpad            /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  rebase               /home/adi/.bazaar/plugins/rebase [0.3.0]
*** 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.
A: 

This is really just a guess, but I suspect that the revision spec isn't accepting 95.3 as a revision.

The merge will have been committed to your branch as revision 100, so you should be able to just do:

bzr uncommit

or:

bzr uncommit -r 100

If you want to merge in changes 95.1 and 95.2 (part of the original merge), you will probably have to do:

bzr uncommit -r 100
bzr merge -r 95..97 /path/to/merge/source

or something like that.

If you need to refer to the 95.3, I'd recommend having a read of the Bazaar revision spec documentation to see if that helps. You may need a more explicit revision number such as revno:95.3 (which probably won't work) or revno:97:/path/to/merge/source (which might work). Most of that was a guess though...

Al
A: 

You can't uncommit to dotted revision like 95.1.3, because this revision is not in your mainline history. You can use pull command instead to get your tree to desired revision:

bzr pull . -r95.1.3 --overwrite

The main difference between uncommit and pull is: uncommit leaves changes after revision to which you uncommit in the working tree, while pull simply overwrite your working tree with files of specified revision.

Also if you need to uncommit to the state just before merge you need to use bzr uncommit without specifying revisions if r100 is the last revision in the branch.

bialix