[Adium-devl] Version control

Richard Laager rlaager at wiktel.com
Mon Oct 8 17:31:48 UTC 2007


On Mon, 2007-10-08 at 12:23 -0400, Augie Fackler wrote:
> On Oct 8, 2007, at 12:10 PM, Richard Laager wrote:
> 
> > On Mon, 2007-10-08 at 01:22 -0700, David Smith wrote:
> >> "fast path" tasks:
> >>
> >> Merge Branch Into Trunk
> >
> > mtn propagate $BRANCH $TRUNK

> >
> > Also, the one you can't do with SVN:
> >
> > # Make a branch
> > # Other commits happen on trunk
> > mtn propagate $TRUNK $BRANCH
> > # Other commits happen on trunk (and maybe on the branch as well)
> > mtn propagate $TRUNK $BRANCH
> > # More commits happen on trunk
> > mtn propagate $TRUNK $BRANCH
> > # You're finally ready to merge it back.
> > mtn propagate $BRANCH $TRUNK
> >
> 
> Can you cover exactly what propagate means here? I've heard the term  
> thrown around but I've never really understood well because....I dunno.

From http://monotone.ca/docs/Tree.html

"This command takes a unique head from sourcebranch and merges it with a
unique head of destbranch, using the least common ancestor of the two
heads for a 3-way merge. The resulting revision is committed to
destbranch. If either sourcebranch or destbranch has multiple heads,
propagate aborts, doing nothing. 

"The purpose of propagate is to copy all the changes on sourcebranch,
since the last propagate, to destbranch. This command supports the idea
of making separate branches for medium-length development activities,
such as maintenance branches for stable software releases, trivial bug
fix branches, public contribution branches, or branches devoted to the
development of a single module within a larger project."

> Does it just merge over changes that happened on trunk? What about a  
> change that happens in both places (say I commit on a branch, merge  
> that one change to trunk), and then I merge trunk to the branch. Will  
> that cause a problem?

Let's cover a sample use:

You have trunk, which we'll call com.adiumx.adiumx. You're working a
branch to add some super-cool feature that'll be a bunch of work. Let's
call that one com.adiumx.adiumx.feature.

You've created the branch by making your first commit, from a trunk
working directory like this:
	mtn ci -b com.adiumx.adiumx.feature -m "The start of a feature."

This created the branch off that point in trunk and switched your
working directory to the branch.

Now, as time goes on, commits happen to both branches. You want to merge
in changes from trunk to your branch. You type the following command to
bring in all the changes that happened on trunk since you merged:
	mtn propagate com.adiumx.adiumx com.adiumx.adiumx.feature

Times goes on further and you want to propagate again. You run the same
command to pull in changes from trunk since the last merge (propagate).
	mtn propagate com.adiumx.adiumx com.adiumx.adiumx.feature

You can keep doing this as often as you want to keep your branch up to
date off trunk.

Now, when your branch is ready to merge to trunk, you type:
	mtn propagate com.adiumx.adiumx.feature com.adiumx.adiumx

Now, maybe it turns out that your feature works pretty well, so it can
stay on trunk, but it needs some fundamental changes. You keep making
changes on your branch, maybe propagating from trunk as desired, and
then you propagate back to trunk again when you're ready.

Note that all of this Just Works. You don't have to track when you did
your last merge, as MTN is doing that for you.

Does that answer your question?

Regarding merging just one change... If you make one one change on the
com.adiumx.adiumx.feature branch that you meant to commit on trunk,
you'll have to use "mtn pluck". That *should* merge fine. That said, you
should commit the changes to the appropriate branch initially.

Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20071008/9f3fa6d8/attachment.sig>


More information about the devel mailing list