[Adium-devl] Version control

Richard Laager rlaager at wiktel.com
Mon Oct 8 16:10:24 UTC 2007


On Mon, 2007-10-08 at 01:22 -0700, David Smith wrote:
> "fast path" tasks:
> 
> Local Commit of Some Files
> Remote Commit of Some Files

I don't understand what local vs. remote means here. A commit in MTN is:
mtn commit (or mtn ci) [files]

With a DVCS, I've found myself committing more frequently, which I
believe is a useful thing. It preserves history and I can commit
separate pieces separately as I go without worrying if it
compiles/works.

And of course, after committing you have to run "mtn push" to push it to
the central server.

> Update of All Files

mtn pull
mtn merge -- If someone pushed changes without merging.
mtn update

> Add File

mtn add $FILE

> Get Diff of Changes

mtn diff

> Get Diff of Changes in a Revision

I don't exactly know what you mean here. If you mean from a revision to
its parent, I generally do this and get the log at the same time:

mtn log --last 1 --diffs --from $REVISION

> Get Log Entry for a Revision

See above.

> Get All Log Entries for a File, Directory, or Checkout

mtn log [$FILE or $DIR]

> Get List of Changed Files

mtn status

> Merge Patch to Maintenance Branch

If you've pulled a patch from the submitter or it has been pushed to
somewhere, then you can merge it in all DVCS style. This is nice for
larger patches. That'd be something like:
	mtn propagate $PATCH_BRANCH com.adiumx.adiumx

Otherwise, for the standard patch:
	patch -p0 < .../patch.diff
	mtn ci --author the_patch_submitter at super_cool_place.com
	# Make changes if necessary and then: mtn ci

> Create Clean Local Copy
mtn -d /path/to/your/adium/database co -b com.adiumx.adiumx [working directory name]

> Switch To Patch-In-Progress Local Copy

I don't understand this for certain. I think you're asking about
switching to a branch?

mtn up -b com.adiumx.adiumx.some_branch
(If some_branch is not a descendant of your current checkout, I believe
you also need: -rh:com.adiumx.adiumx.some_branch)

> less frequent tasks:
> 
> Create Remote Branch

mtn approve -b $BRANCH_NAME $REVISION
mtn push

But really, that's pointless. What you really want is this:

# Make your first set of changes for the branch.
mtn ci -b $NEW_BRANCH
# Optionally, other changes.
mtn push

> 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

> Local Commit of All Files

mtn ci

> Remote Commit of All Files

I don't get this? Do you mean:
mtn ci
mtn push

> Get Diff of Changes in a Revision Range

mtn diff -r $FROM -r $TO

> Anything Involving svn blame

This is identical. It was annotate with CVS, annotate with SVN, and it's
still annotate in MTN.

mtn annotate



As far as pushing and pulling goes, here's what I end up with most of
the time:

I update like this:
mtn pull
mtn update

# I develop things, doing a lot of "mtn commit"s.
$EDITOR foo
mtn ci
...

# I re-pull to make sure there are no other changes.
mtn pull

# If that pulled in something, I merge the heads.
mtn merge

# Then I push.
mtn push

You may find this useful:
http://monotone.ca/docs/CVS-Phrasebook.html

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/b1a252e3/attachment.sig>


More information about the devel mailing list