monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Throwaway branches


From: Bruce Stephens
Subject: [Monotone-devel] Throwaway branches
Date: Sat, 30 Apr 2005 22:40:48 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

i.e., branches that you use to prepare changes that go somewhere else,
which have no long-term value in themselves.

Propagate seems to have three cases.  If you're propagating from
branch src to dst, then either:

   1. src is an ancestor of dst, in which case there's nothing to do

   2. dst is an ancestor of src, in which case there's no merging to
      be done: just add src to the dst branch

   3. do a merge of src and dst

In case 2, the revision's unchanged (it's still a child of a revision
in src), so in monotone-viz it looks kind of a strange disconnection.
3 is a new revision, which is a merge: its parents are the head
revisions of src and dst.


So I was thinking that case 2 is almost what I'd want for throwaway
branches.  Suppose I'm working on a change for branch "net.foo", and I
do it on some branch "scratch.foo", then I make several changes on
scratch.foo, and frequently propagate from net.foo.  

Now, suppose I'm happy with my changes, and want to put them on
net.foo.  First I propagate from net.foo, to make sure I've got all
the changes.  Then I do a psuedo-propagate from scratch.foo to
net.foo.  And that doesn't require any merge.  (Of course, once
net.foo gets synced up with other databases there may be a need for
merges.)

This psuedo-propagate makes a revision that's very like the head of
scratch.foo, only its ancestor is the head of net.foo.  Its branch is
net.foo, and its changelog can be anything I want; maybe I want to add
something that will allow future tools to tell what I've done.  Perhaps
the changelog could being with
   publish from branch 'scratch.foo' (head ...)
             to branch 'net.foo' (head ...)

or something.  Or maybe it would be better to have a separate cert.

Anyway, that should mean that I can happily serve net.foo without
scratch.foo, and everything will work as I'd want, since net.foo
doesn't have any ancestors on scratch.foo.  So if I find my database
has too much crud in it, I can just sync the important branches to
another database.

Of course, if I accidentally use propagate rather than
psuedo-propagate (or publish, which is my current idea for the command
name) then things will screw up.  So I think I'll need a hook that
knows my conventions for such private branches, and won't let me
propagate from them to non-private branches.  That'll still let me
propagate between such branches, sync them between databases, etc.,
but should mostly prevent accidents.


This seems suspiciously straightforward (I haven't tried coding this,
so perhaps I'll stumble over difficulties then), so what am I missing?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]