confused about push/pull/merge and append_revisions_only

Alexander Belchenko bialix at ukr.net
Sun Jan 15 08:40:08 UTC 2012


Chris Hecker пишет:
> I have a repository I push to from multiple places.  I recently set
> append_revisions_only on it, because it's the main server repo, and I
> was always weirded out by a bzr client's ability to modify the existing
> history, which seemed to go against the idea of source code control.
> However, I clearly don't understand something, because now I can't push
> to the repo.
> 
> I did a pull, but my local history had diverged (this was expected,
> since I'd done some work locally), so I did a merge from the server and
> a local commit.  Then I went to push, which was my normal workflow, but
> I got this:
> 
> Using saved push location: /home/checker/bzr/spyparty/
> bzr: ERROR: Operation denied because it would change the main history,
> which is not permitted by the append_revisions_only setting on branch
> "/home/checker/bzr/spyparty/".
> 
> Now I'm not sure what my workflow should be.  How do I push changes back
> to the server repository?  Do I not want append_revisions_only?

Instead of merging server branch to your local branch you should get a 
copy of server branch on your computer and then merge your local 
branch into local copy of server branch. (Sometimes this operation 
called "landing a branch"). After that you can push to server new 
changes. That way append_revisions_only will work. The other way it 
won't. Because when you merge to server branch then your new changes 
will be a new revision on top of the existing history of server 
branch, therefore you can push new revision to server with 
append_revisions_only. If you merge server to local work branch then 
diverged changes from server will be a new revision on top of the 
existing history of local work branch and diverged revisions from 
server branch that had integer revision numbers (e.g. 100,101,102) 
will be dotted revisions (e.g. 99.1.1,99.1.2,99.1.3) and therefore 
that will break append_revisions_only rule.

So you do:

bzr branch URL/server/branch local/copy/of/server
cd local/copy/of/server
bzr merge your/local/work
bzr st
bzr diff
bzr commit -m "merge local work into server branch"
bzr push URL/server/branch

If you're planning to continue your work in local work branch it's 
better to make it full copy of server branch after merge:

cd your/local/work
bzr pull URL/server/branch

HTH



More information about the bazaar mailing list