当我有历史时
-rev 100,合并
- rev 95.3
- rev 95.2
- rev 95.1
-rev 99
-rev 98
我尝试bzr uncommit -r 95.3..
它会写一条错误信息。我该如何解决这个问题?
错误是
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.
答案 0 :(得分:0)
这只是一个猜测,但我怀疑修订规范不接受95.3作为修订。
合并将作为修订版100提交给您的分支机构,因此您应该能够做到:
bzr uncommit
或:
bzr uncommit -r 100
如果要合并更改95.1和95.2(原始合并的一部分),您可能需要这样做:
bzr uncommit -r 100
bzr merge -r 95..97 /path/to/merge/source
或类似的东西。
如果您需要参考95.3,我建议您阅读Bazaar revision spec documentation,看看是否有帮助。您可能需要更明确的修订版号,例如revno:95.3
(可能不起作用)或revno:97:/path/to/merge/source
(可能有效)。大多数情况都是猜测......
答案 1 :(得分:0)
您不能拒绝像95.1.3这样的虚线修订,因为此修订版不在您的主线历史记录中。您可以使用pull
命令将树转换为所需的版本:
bzr pull . -r95.1.3 --overwrite
uncommit
和pull
之间的主要区别在于:uncommit
会在修改后留下您在工作树中取消提交的更改,而pull
只会覆盖您的工作树指定版本的文件。
此外,如果您需要在合并之前取消对状态的拒绝,则需要使用bzr uncommit
而不指定修订版,如果r100是分支中的最后一个修订版。