confused about push/pull/merge and append_revisions_only

John Arbash Meinel john at arbash-meinel.com
Sun Jan 15 14:37:01 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 1/13/2012 10:52 PM, Chris Hecker wrote:
> 
> 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?
> 
> Thanks, Chris
> 
> 

Just to mention, this is the exact behavior you are asking for with
append_revisions_only. If you don't have it set, no history is ever
*lost* just rearranged. Looking at it from 'bzr log' perspective, what
you have right now is:

$ bzr log --include-merges trunk

- ------------------------------
revno: 120
message: Tip of trunk
...


$ bzr log --include-merges mybranch
- ------------------------------
revno: 123 [merge]
message: My merge of trunk
...
  ------------------------------
  revno: 119.1.1
  message: Tip of trunk
  ...
- ------------------------------
revno: 122
message: The last commit of my branch


With append_revisions_only=False (the default), we allow you to push
mybranch's rev 123 over the trunk branch, because the branch's 119.1.1
revision is the same as the current trunks 120 revision.
You can see that the revno for the trunk tip revision will have
changed. The revision is still in the ancestry, just not at the same
place in the graph. With append_revisions_only you have to create a
history that looks like:

$ bzr log --include-merges correct-branch

- ------------------------------
revno: 121 [merge]
message: Merge of my feature
...
  ------------------------------
  revno: 113.1.10
  message: The last commit of my branch
  ...
- ------------------------------
revno: 120
message: Tip of trunk
...

That is the difference between merging your branch into trunk, and
merging trunk into your branch (direction matters).

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8S5I0ACgkQJdeBCYSNAAPOKwCfULaLnKKj5WiPPnqfiODqt99E
kKAAoKMkOf8N1fTSAstDehHPdf2i/FSl
=3g56
-----END PGP SIGNATURE-----



More information about the bazaar mailing list