dpush raises NoSuchRevision

Bug #680850 reported by Matt Giuca
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Git Plugin
Fix Released
High
Jelmer Vernooij

Bug Description

I always get NoSuchRevision when using dpush on bzr-git 0.5.2 with bzr 2.2.1 on python 2.6.6 (Linux-2.6.35-22-generic-i686-with-Ubuntu-10.10-maverick). Using git version 1.7.1.

An example session, from the beginning:

$ git init gitrepo
$ cd gitrepo
gitrepo$ echo "Hello world" > foo
gitrepo$ git add foo
gitrepo$ git commit -m "git: Added foo"
gitrepo$ cd ..
$ bzr branch gitrepo bzrbranch
$ cd bzrbranch
bzrbranch$ echo "Goodbye socks" >> foo
bzrbranch$ bzr ci -m "bzr: Added line to foo."
bzrbranch$ bzr log --show-ids
------------------------------------------------------------
revno: 2
revision-id: <email address hidden>
parent: git-v1:b8145f2213f44891fe6c5b1f3207d503361c5e34
committer: Matt Giuca <email address hidden>
branch nick: bzrbranch
timestamp: Wed 2010-11-24 21:21:38 +1100
message:
  bzr: Added line to foo.
------------------------------------------------------------
revno: 1
revision-id: git-v1:b8145f2213f44891fe6c5b1f3207d503361c5e34
git commit: b8145f2213f44891fe6c5b1f3207d503361c5e34
committer: Matt Giuca <email address hidden>
timestamp: Wed 2010-11-24 21:20:40 +1100
message:
  git: Added foo

Note: At this point the bzr repo contains one git revision and one ordinary bzr revision.

bzrbranch$ bzr dpush ../gitrepo/
bzr: failed to report crash using apport:
     OSError(13, 'Permission denied')
bzr: ERROR: bzrlib.errors.NoSuchRevision: <LocalGitBranch('file:///home/matt/Desktop/newgittest/gitrepo/', 'HEAD')> has no revision <email address hidden>

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 912, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1112, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 690, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/foreign.py", line 339, in run
    push_result.report(self.outf)
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 3146, in report
    note('Pushed up to revision %d.' % self.new_revno)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/branch.py", line 416, in new_revno
    return self._lookup_revno(self.new_revid)
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/branch.py", line 408, in _lookup_revno
    return self.target_branch.revision_id_to_revno(revid)
  File "/usr/lib/python2.6/dist-packages/bzrlib/branch.py", line 1041, in revision_id_to_revno
    raise errors.NoSuchRevision(self, revision_id)
NoSuchRevision: <LocalGitBranch('file:///home/matt/Desktop/newgittest/gitrepo/', 'HEAD')> has no revision <email address hidden>

bzr 2.2.1 on python 2.6.6 (Linux-2.6.35-22-generic-i686-with-Ubuntu-10.10-maverick)
arguments: ['/usr/bin/bzr', 'dpush', '../gitrepo/']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_AU.utf8'
plugins:
  bash_completion /usr/lib/python2.6/dist-packages/bzrlib/plugins/bash_completion [2.2.1]
  bzrtools /usr/lib/python2.6/dist-packages/bzrlib/plugins/bzrtools [2.2.0]
  git /usr/lib/python2.6/dist-packages/bzrlib/plugins/git [0.5.2]
  launchpad /usr/lib/python2.6/dist-packages/bzrlib/plugins/launchpad [2.2.1]
  netrc_credential_store /usr/lib/python2.6/dist-packages/bzrlib/plugins/netrc_credential_store [2.2.1]
  news_merge /usr/lib/python2.6/dist-packages/bzrlib/plugins/news_merge [2.2.1]
  rewrite /usr/lib/python2.6/dist-packages/bzrlib/plugins/rewrite [0.6.1]
  svn /usr/lib/python2.6/dist-packages/bzrlib/plugins/svn [1.0.3]

Now from the error, it would appear that bzr-git is looking for a revision called "<email address hidden>" (that is, the revision ID which bzr gave to revision 2) in the git repository. I'm not sure why it's doing that, since the whole point of dpush is to push changes there without expecting them to arrive intact.

In any case, it seems not to matter. I *always* get this exception (unless there are no changes to push) but it *always* succeeds anyway. If I do a bzr log again, I see that it has been "dpushed" and become a standard git revision:

bzrbranch$ bzr log --show-ids
------------------------------------------------------------
revno: 2
revision-id: git-v1:d648b2c25ad1d500b110e80174540d02067a292c
parent: git-v1:b8145f2213f44891fe6c5b1f3207d503361c5e34
git commit: d648b2c25ad1d500b110e80174540d02067a292c
committer: Matt Giuca <email address hidden>
timestamp: Wed 2010-11-24 21:21:38 +1100
message:
  bzr: Added line to foo.
------------------------------------------------------------
revno: 1
revision-id: git-v1:b8145f2213f44891fe6c5b1f3207d503361c5e34
git commit: b8145f2213f44891fe6c5b1f3207d503361c5e34
committer: Matt Giuca <email address hidden>
timestamp: Wed 2010-11-24 21:20:40 +1100
message:
  git: Added foo

Note that revision 2 has changed its revision ID to a git one, lost its branch nick, and gained a git commit ID.

Sure enough, in git:
bzrbranch$ cd ../gitrepo/
gitrepo$ git log
commit d648b2c25ad1d500b110e80174540d02067a292c
Author: Matt Giuca <email address hidden>
Date: Wed Nov 24 21:21:38 2010 +1100

    bzr: Added line to foo.

commit b8145f2213f44891fe6c5b1f3207d503361c5e34
Author: Matt Giuca <email address hidden>
Date: Wed Nov 24 21:20:40 2010 +1100

    git: Added foo

So it is working. It is just throwing an annoying exception too.

Tags: dpush verified
Matt Giuca (mgiuca)
summary: - NoSuchRevision
+ dpush raises NoSuchRevision
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks for the bug report. This is fixed in trunk.

Changed in bzr-git:
status: New → Triaged
status: Triaged → Fix Committed
importance: Undecided → High
assignee: nobody → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer)
tags: added: verified
Jelmer Vernooij (jelmer)
Changed in bzr-git:
milestone: none → 0.5.3
status: Fix Committed → Fix Released
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.