branching with with 0 revisions causes an error

Bug #249074 reported by Pete Kelly
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

(Steps to reproduce follow) I am currently in the process of evaluating bzr as an existing svk/svn user. As part of my experimentation I initialised a repo, then created a branch and immediately branched it. On the new branch I committed a file and merged the original branch with the new branch (still following?!) The merge appeared to work fine, but when issuing bzr status in the original branch I got the following error:

working tree is out of date, run 'bzr update'

I dutifully ran bzr update, but the following happened:

-D testfile
All changes applied successfully.
bzr: ERROR: Reserved revision-id {null:

I've tried this a few times and can reproduce it each time, and have come to the conclusion that if you create a branch in a repository with 0 revisions, subsequent merges into the original branch cause a strange error in bzr.

I know it is a very unlikely situation, but an error message stating that it's invalid to branch at this revision would be more user friendly.

Steps to reproduce:

mkdir testdir && cd testdir
bzr init-repo test_repo && cd test_repo
bzr init live
bzr branch live branch1
cd branch1
vi testfile # enter some text and save
bzr add testfile
bzr commit -m "new file" testfile
cd ../live
bzr merge ../branch1
#... all seems OK so far .. continue..
bzr status # says working tree out of date
bzr update # strange message appears at this point.

Output from bzr --version:
Bazaar (bzr) 1.5
  Python interpreter: /usr/bin/python 2.5.2
  Python standard library: /usr/lib/python2.5
  bzrlib: /usr/lib/python2.5/site-packages/bzrlib
  Bazaar configuration: /home/pkelly/.bazaar
  Bazaar log file: /home/pkelly/.bzr.log

Using ubuntu hardy heron.

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 249074] [NEW] branching with with 0 revisions causes an error

On Wed, 2008-07-16 at 14:38 +0000, Pete Kelly wrote:
> Public bug reported:
>
> (Steps to reproduce follow) I am currently in the process of evaluating
> bzr as an existing svk/svn user. As part of my experimentation I
> initialised a repo, then created a branch and immediately branched it.
> On the new branch I committed a file and merged the original branch with
> the new branch (still following?!) The merge appeared to work fine, but
> when issuing bzr status in the original branch I got the following
> error:

Hi,

Thanks for your bug report.

I thought we had this problem before, or was that a different operation?
I thought it was supposed to fail gracefully and suggest "bzr pull"
now.

Thanks,

James

Revision history for this message
Pete Kelly (p3k4y) wrote :

I did notice two very similar bugs, but they were slightly different scenarios.

I am not sure how bzr works internally so went for a new bug anyway.

The other two are:
bug 82555
bug 242175

I've just tried bzr pull, and it does indeed work. Seems a little odd though, as I said above it would make more sense (to me) to stop you branching at all from revision 0

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 249074] Re: branching with with 0 revisions causes an error

On Wed, 2008-07-16 at 15:25 +0000, Pete Kelly wrote:
> I've just tried bzr pull, and it does indeed work. Seems a little odd
> though, as I said above it would make more sense (to me) to stop you
> branching at all from revision 0
>

I think we want to allow this, so you can do something like

  bzr init bzr+ssh://wherever
  bzr branch bzr+ssh://wherever
  hack
  bzr commit
  bzr push

However, we should handle merge in to an empty branch gracefully,
and probably disallow it.

Thanks,

James

Jelmer Vernooij (jelmer)
Changed in bzr:
importance: Undecided → Low
status: New → Triaged
Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
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.