feature request for pull and merge

HyperQuantum hyperquantum at gmail.com
Thu Dec 27 13:30:28 GMT 2007


Hi. First of all, congratulations with the 1.0 release! I am using
Bazaar for some time now and it's really useful. There's one thing
missing though, that's why I'm sending this feature request :-)

I am using bzr for a project with multiple branches, and I have two
machines I work on. There is a main branch (call it "trunk" if you
want to) and there are two other branches derived from it with more
experimental development going on. When I start to work I need to pull
my changes from the same branch on the other machine first. But for a
derived branch I also regularly merge the latest changes of the main
branch (on the same machine or the other one). So I have at least two
potential sources for pull and merge, and the one I used first was
remembered by bzr as the "parent branch". This means I need to do a
'bzr info' first in order to see what branch bzr will use to
pull/merge from when I don't specify the URL, and most of the time I
have to type the URL to use. It would be nice not having to type the
URL each time.

So I propose two new commands, "bzr imerge" and "bzr ipull" (for
interactive merge/pull) that will ask the user what branch to
pull/merge from. And any branch URL ever specified with the regular
"merge" and "pull" commands would end up in that list. The new
commands would also offer the option of typing a new URL that is not
in the list yet.

Let's see how this would look like for "bzr ipull":

  $ bzr ipull
  Please specify the branch to pull from:
   --> (1) file:///home/user/path/to/branch/
       (2) bzr+ssh://user@othermachine/home/user/path/to/branch/
       (3) <specify another URL>

The command lists all URLs that were used before plus an extra option
to specify a new one. An arrow points to the first option in the list.
When presented with the choices above, the user could just press ENTER
to have the first option used. After the URL was chosen the command
would behave just like the regular "pull" command. Alternatively, the
user can press the down arrow key on his keyboard to move the arrow to
the second option:

  $ bzr ipull
  Please specify the branch to pull from:
       (1) file:///home/user/path/to/branch/
   --> (2) bzr+ssh://user@othermachine/home/user/path/to/branch/
       (3) <specify another URL>


... and then press ENTER to have the second option chosen. If he does
that, the second choice will be moved to the first position in the
list for the next time the command is used. It is useful to have the
most recently chosen options on top of the list. I think the option
list should be shared for both "ipull" and "imerge", because if you do
an "ipull" and it fails because branches have diverged, you can do
"imerge" and have the URL you want directly on top of the list.

Suppose the user scrolled to the third option and pressed ENTER, he
can type the URL he wants:

  $ bzr ipull
  Please specify the branch to pull from:
       (1) file:///home/user/path/to/branch/
       (2) bzr+ssh://user@othermachine/home/user/path/to/branch/
   --> (3) <specify another URL>
  Enter the URL: (user can type URL here)

And again, the URL that is chosen will be displayed as the first
option in the list next time. Don't know if these new commands belong
in bzr itself or some external thing like bzr-tools. This concept
might be useful for "bzr push" as well, though that seems less likely
as you would publish a branch to only one location IMO (though other
people might disagree). If it would be too difficult to support the
use of the arrow keys, you could also have the user enter the option
number instead (and an ENTER without input would imply the first
option used). Maybe some way to delete old/unused URLs from the option
list might be useful as well (maybe put the options in a file the user
can edit?).

What do you guys think about this proposal?


Greetings,
H.Q.



More information about the bazaar mailing list