On 5/22/07, Richard Levitte <[EMAIL PROTECTED]> wrote:

What you're missing in the whole thing is the ancestry.  You see, with
your last commit (which is to branch1), you're using the previous
commit (which is in branch2) as ancestor, so even if you're not doing
a propagate, you are producing a history that goes back and forth
between the branches.


Yes I understand that if i had updated it would have fixed the issue.  and
at the time I did the commit I thought about doing an update ... except I
knew that the other branch already had split heads, and didn't really want
some of the other changes merged inot my current code at that moment....
isn't there a way to say like 'commit this agains the head of the branch?'
oh - except as I just said there' were aready 2 heads so ...




To do what you ask for, you need to do an update in the middle, so it
looks like this:

mtn --db=test.db db init
mtn --db=test.db genkey temp

mtn --db=test.db --key=temp --branch=branch1 setup .

echo "Branch1" >file
mtn --db=test.db --key=temp  add file
mtn --db=test.db --key=temp  commit -m "Begin branch1"

echo "+Branch2" >>file
mtn --db=test.db --key=temp --branch=branch2 commit -m "Changed file,
begin branch2"

# THIS IS THE MISSING PIECE
mtn --db=test.db --key=temp --revision=h:branch1 update

echo "branch1" >file2
mtn --db=test.db --key=temp add file2
mtn --db=test.db --key=temp --branch=branch1 commit -m "Add a file to
branch1"

mkdir checkout
cd checkout
mtn --db=../test.db --key=temp --branch=branch1 co .

In message <[EMAIL PROTECTED]>
on Tue, 22 May 2007 01:24:51 -0700, "J Decker" <[EMAIL PROTECTED]> said:

d3ck0r> I was doing some work, and decided that I wanted to commit that
work to a
d3ck0r> new branch, so as to not distrub other developers too badly... I
still
d3ck0r> haven't completely tested the changes, but it turns out that the
changes
d3ck0r> were included in the main branch anyhow because I then made some
other
d3ck0r> changes to files and commited them against the main branch,
without first
d3ck0r> updating to that branch.  At the time I wondered if monotone would
be really
d3ck0r> smart about the thing that I did, but as it turns out, the branch
tag I
d3ck0r> applied to the revision basically made no difference...
d3ck0r>
d3ck0r> This is a script which reproduces effectively what I did.  What I
would have
d3ck0r> expected in the final checkout would have been 'file' with content
'Branch1'
d3ck0r> and 'file2' with content 'branch1'.  Instead, I get 'file' with
content
d3ck0r> 'branch1 + branch2' but I did not propagate the branches... so I
would not
d3ck0r> have expected the changes to be merged...
d3ck0r>
d3ck0r> Maybe an artificial warning/error can be generated to alert the
user that
d3ck0r> such a thing will not produce what they might expect?
d3ck0r>
d3ck0r>
d3ck0r>
d3ck0r> mtn --db=test.db db init
d3ck0r> mtn --db=test.db genkey temp
d3ck0r>
d3ck0r> mtn --db=test.db --key=temp --branch=branch1 setup .
d3ck0r>
d3ck0r> echo "Branch1" >file
d3ck0r> mtn --db=test.db --key=temp  add file
d3ck0r> mtn --db=test.db --key=temp  commit -m "Begin branch1"
d3ck0r>
d3ck0r> echo "+Branch2" >>file
d3ck0r> mtn --db=test.db --key=temp --branch=branch2 commit -m "Changed
file, begin
d3ck0r> branch2"
d3ck0r>
d3ck0r> echo "branch1" >file2
d3ck0r> mtn --db=test.db --key=temp add file2
d3ck0r> mtn --db=test.db --key=temp --branch=branch1 commit -m "Add a file
to
d3ck0r> branch1"
d3ck0r>
d3ck0r> mkdir checkout
d3ck0r> cd checkout
d3ck0r> mtn --db=../test.db --key=temp --branch=branch1 co .
d3ck0r>
d3ck0r>
d3ck0r>
d3ck0r>  -------------------
d3ck0r>
d3ck0r>
d3ck0r>
d3ck0r> Again, I was working on 'branch', made changes I didn't want to
share with
d3ck0r> the public yet and commited changes on --branch='branch.test'.  I
then
d3ck0r> modified other code, and commited that code using
--branch='branch' to
d3ck0r> commit it against the main branch instead of branch.test.  But at
the end,
d3ck0r> the changes added to branch.test were included in 'branch'
automatically...


_______________________________________________
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel

_______________________________________________
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to