Tue 14 Nov 2006 11:50:41 PM UTC, original submission:
Suppose I have a database containing branches "upstream" and "private", where I pulled "upstream" from another database and branched at some point into the "private" branch:
$ mtn db init my_db.mtn
$ mtn --db=my_db.mtn pull foo.bar upstream
$ mtn --db=my_db.mtn checkout upstream private
(edit the files)
$ mtn commit --branch=private
At this point, it is quite easy to review my changes:
$ mtn diff -r h:upstream -r h:private
but later on, I do another pull:
$ mtn pull
and I want to see the changes, in the upstream branch, since the branch point. With Bazaar-NG:
$ bzr diff -r ancestor:../upstream..branch:../upstream
gives what I want: the diff between the branch point and the head of the upstream branch. Satisfied with my review of the changes, I now propagate into my private branch, do some more edits, then pull again from upstream:
$ mtn propagate upstream private
(edit)
$ mtn commit
$ mtn pull
Now I want to see the changes in the upstream branch since the last "propagate". Again, Bazaar-NG's ancestor mechanism comes to the rescue:
$ bzr diff -r ancestor:../upstream..branch:../upstream
This means that the "common ancestor" is either the latest propagated revision if there is one, or the branch point.
I propose the following syntax for Monotone:
$ mtn diff -r f:upstream -r h:upstream
If invoked outside of a working copy, 'f:' would require two branches, e.g.
$ mtn --db=my_db.mtn diff -r f:upstream:private -r h:upstream
If invoked in a working copy whose branch is already "upstream", 'f:upstream' would be equal to 'h:'.
--
Ludovic Brenta.
|