monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Monotone to and from Subversion


From: William Uther
Subject: Re: [Monotone-devel] Monotone to and from Subversion
Date: Tue, 22 Jan 2008 16:04:37 +1100

Hi,
I was looking at the same thing. Tailor did not seem a 100% satisfactory solution, although it could be worse.

I was thinking at one point of using the same idea used in the cvssync.attrs branch. It would be much easier with subversion.

Basically, you have one micro-branch that is the 'subversion' line. There is a cert attached to the any monotone revision that corresponds to a subversion revision. The cert contains the subversion repository and revision information.

To do a 'pull' from subversion into monotone, you find the last monotone revision with a cert from the repository you're pulling from. You read from the cert which revision it is up to. You loop forward from there checking out from subversion and checking in to monotone. I don't know how you can easily get diffs out of subversion, but you could do the check-ins to monotone without a workspace which should speed things up.

To do a 'push' from monotone into subversion, you first find the last monotone revision with a cert from the repository you're pulling from. If the subversion revision in that cert doesn't match the head revision of the repository then you need to abort and tell the user to pull first. If it does match, then you can push all descendants of that revision (you might want to warn the user if they're not merged). Loop through the descendants of the last synced revision and find the longest path (to the head?). That will be the set of revisions you'll commit. Loop along this path towards the head, committing each monotone revision in turn. Each time you commit a monotone revision to subversion, you can attach a cert to it marking it as committed.

Note that this does NOT commit every revision in monotone into subversion. Subversion can only hold a linear history. If there is a non-linear history in monotone, then only one line of that history will be committed as separate revisions. The other line will be committed as one great diff when the merge revision is committed.

The only other tricky bit is the log messages to use in a push. You could just use the corresponding monotone log messages, but this loses log messages when merge revisions are pushed. In this situation, cvssync makes a composite commit message. Every revision that has multiple parents will get a composite commit message. The message is the concatenation of the log messages of every ancestor of the merge revision that is not also the ancestor of an already synced revision. This makes sure that log messages go with the revision that commits the diffs, even if they are lumped together because of the non- linear history.

  I have other things to do right now :)

Cheers,

Will        :-}

On 22/01/2008, at 3:32 PM, Grahame Bowland wrote:


Hey guys

I'm going to be in a situation where getting to a subversion
repository is a pain. I'd like to export from subversion into monotone
and then work committing to the the monotone database, but in a way
which makes it easy for me to pull updates from subversion upstream
and also commit my patches back (with changelog entries, etc).

Does anyone have a way of doing this that they've found works well? It
seems like I could just hack something together with a few scripts and
tailor, but I thought I'd ask in case someone else has already done
it!

Thanks
Grahame


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






reply via email to

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