[BUG] when doing a bzr pull with conflicts

James Blackwell jblack at merconline.com
Mon Sep 19 11:13:26 BST 2005


On Mon, Sep 19, 2005 at 12:04:17PM +1000, Robert Collins wrote:
> > > If I understood you correctly, then it seems like this might confuse
> > > some cvs and svn users since in cvs/svn, update actually does do
> > > something like a merge with the "current branch", and you would
> > > normally run update whether you've committed or not.
> > 
> > I talked with Abentley about this awhile ago. My personal opinion is that
> > users want "Get missing code from there and put it here" and that the tool
> > can tell whether it should be doing a merge or a pull, that there should
> > just be one command.
> 
> I think users will care intensely.

[great example]

I agree completely that the result is something users deeply care about.
I don't suggest that merge be taken away and replaced with pull.

Basically, I think I'm failing with you and abentley in the same place.
I'm not suggesting any sort of change in behavior, just a minor tweak in
the ui.

Since bzr can tell that when the user wants to run a "pull" they really
want to run a "merge", why not just have one "pull" command. This command
can pull or merge based upon whether or not the tree is diverged.

User Case 1 (current) 
  ~/ $ cd working-tree
~/wt $ bzr pull
Your working tree is not up to date, blah blah
~wt  $ bzr merge      (this works)
~/wt $ bzr pull       (this dies not work, tree is diverged)

Suggested Use Case #1: 

   ~/$ bzr pull URL wt
   ~/$ cd wt
[ wait a few days]
~/wt $ bzr pull
[ several patches are applied in customary "bzr pull" fashion"

Suggested Use Case #2:
  ~/$ bzr pull URL wt
  ~/$ cd wt
~/wt$ touch MY_SEKRET_CODE
~/wt$ bzr add *
~/wt$ bzr commit -m"My code"
~/wt$ bzr pull
[ bzr detects divergance. Instead of trying to do what bzr pull used to
do, it instead does what is customarily done by "bzr merge"]


Since Baz-NG already enforces "now you can pull, now you can merge", it
doesn't make too much sense to force the user to have two different
commands which are similiar but contradictory. (you pull until diverged,
once diverged you merge and never pull)*


Example #1:

   ~/$ cd working-tree   [I'm lazy, so I'll call it wt instead]
~/wt $ bzr pull          [ x-pull says http://jblack/fux-numbers ]
[ bzr examines wt to determine whether local commits have happened.
     If so, it performs what is now called "bzr merge"
     If no, it performs a bzr pull    ]


* There is one exception: Merging something in into a branch that up to
  this point hasn't diverged. This state can be identified as well,
  because the user has specified an url that doesn't match x-pull

> Heres a scenario:
> 
> I have a branch, the mainline for project Foo.
> you branch from me and do some work....
> commit -m 'delete random stuff' ; ...
> commit -m 'add in replacements' ; ...
> commit -m 'fix bug 45'
> 
> Now, I want to get everything you've done..
> bzr merge $jblack;
> bzr commit -m 'merge bug fux 45 from jblack'.
> 
> I'd like to see the following in bzr log:
> r 3
> message: 'merge bug fux 45 from jblack'
> ====
> r2
> message: 'what I had before'
> ...
> 
> 
> If the tool appends history, which its able to in this scenario, what
> I'd see is:
> r5
> message: 'fix bug 45'
> ====
> r4
> message: 'add in replacements'
> ====
> r3
> message: 'delete random stuff'
> ====
> r2
> message: 'what I had before'
> ...
> 
> 
> Which is _not_ what ever existed in my mainline, and not what I want
> people to see when they walk back along my history.
> 
> I think that we need two semantically different commands,
> $collapse-and-let-me-commit and $append-their-stuff-to-mine.
> $append-their-stuff-to-mine could well degrade into
> $collapse-and-let-me-commit if the branches have diverged.
> 
> Rob
> 
> 
> 
> -- 
> GPG key available at: <http://www.robertcollins.net/keys.txt>.



-- 
 James Blackwell      |   Try out the blog planet for revision control
 Tell someone a joke! |   at http://planet.revisioncontrol.net
----------------------------------------------------------------------
GnuPG (ID 06357400) AAE4 8C76 58DA 5902 761D  247A 8A55 DA73 0635 7400




More information about the bazaar mailing list