Code review comment for lp:~guilhem-bichot/bzr/bzr-pull-verbose-shows-tip-before-pull

Revision history for this message
GuilhemBichot (guilhem-bichot) wrote :

Hello John. Thanks much about the explanation about encoding of revids, I had mixed things a bit :-)
This test fails:
./bzr selftest -v bzrlib.tests.blackbox.test_too_much.TestCommands.test_pull_verbose
with this error:
Traceback (most recent call last):
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/tests/blackbox/test_too_much.py", line 150, in test_pull_verbose
    out = self.run_bzr('pull --overwrite --verbose ../a')[0]
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/tests/__init__.py", line 1887, in run_bzr
    working_dir=working_dir,
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/tests/__init__.py", line 1798, in _run_bzr_autosplit
    encoding=encoding, stdin=stdin, working_dir=working_dir,
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/tests/__init__.py", line 1831, in _run_bzr_core
    args)
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/tests/__init__.py", line 2125, in apply_redirected
    return a_callable(*args, **kwargs)
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/commands.py", line 1139, in run_bzr_catch_user_errors
    return run_bzr(argv)
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/commands.py", line 1037, in run_bzr
    ret = run(*run_argv)
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/commands.py", line 654, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/builtins.py", line 1034, in run
    result.old_revid)
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/decorators.py", line 140, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/branch.py", line 346, in revision_id_to_dotted_revno
    return self._do_revision_id_to_dotted_revno(revision_id)
  File "/home/mysql_src/logiciels/bzr_versions/bzr-pull-verbose-shows-tip-before-pull/bzrlib/branch.py", line 366, in _do_revision_id_to_dotted_revno
    raise errors.NoSuchRevision(self, revision_id)
NoSuchRevision: BzrBranch7('file:///tmp/testbzr-JIm8BM.tmp/bzrlib.tests.blackbox.test_too_much.TestCommands.test_pull_verbose/work/b/') has no revision guilhem@guilhem-laptop-20091209125135-072j1altswyqu916

The reason is that this is a pull *--overwrite*, so this new code:
                    old_dotted_revno = branch_to.revision_id_to_dotted_revno(
                        result.old_revid)
fails, because the branch after pull doesn't have this revid anymore (it was overwritten).
I see two solutions:
1) print the revid (even though it's not in the branch anymore, it can still be used to recreate the past branch from another location)
2) print a message saying that the old revision is not there anymore (less helpful but does not violate UI policies).

« Back to merge proposal