monotone-devel
[Top][All Lists]
Advanced

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

[Monotone-devel] "import" explained...


From: Richard Levitte - VMS Whacker
Subject: [Monotone-devel] "import" explained...
Date: Fri, 01 Dec 2006 23:57:54 +0100 (CET)

Hi,

A couple of days ago, I implemented an "import" command that basically
does the same kind of thing as "cvs import" except it doesn't do any
propagation.  All it does is import a source tree to a branch of your
choice (initial import works as well).

The really basic data that command takes is either --revision or
--branch, and the directory where the source tree resides.  If
--branch is given, the import will become a child revision of the head
of that branch.  If --revision is given, the import will become a
child revision of that revision.

What happens is the following:

 - construct a temporary _MTN, including _MTN/revision with a correct
   old revision identity (i.e. the head of the given branch, or the
   given revision identity).
 - perform "add --unknown".
 - perform "drop --missing".
 - perform "commit" with the given message (through --message or
   --message-file).
 - clean away the temporary _MTN.

Really, all of the above could have been done manually if it wasn't
for that damn _MTN/revision that needs to be constructed by hand, and
it's better if monotone itself does that correctly than having a
script do it wrongly (perhaps not today, but the next time the format
changes).

The two use cases I have are the following:

 - Tracking a CVS flow with no regard for CVS history:

        $ cd {project}
        $ cvs update -dP
        $ mtn import . \
                -d {database} \
                -b {project}.import \
                -m "Import of project, `date '+%Y%m%d %H:%M'`"
        $ mtn propagate -d {database} {project}.import {project}

 - Tracking new versions of software:

        $ tar -xvzf kphotoalbum-2006-11-27-noi18n.tar.gz
        $ mtn import kphotoalbum-2006-11-27-noi18n \
                -d {database} \
                -b free.lp.se:kphotoalbum.import \
                -m "Import of KPhotoAlbum, `date '+%Y%m%d %H:%M'`"
        $ mtn propagate -d {database} \
                free.lp.se:kphotoalbum.import \
                free.lp.se:kphotoalbum

The second case is especially painful to do manually, because of the
need to create that _MTN directory and the _MTN/revision file.

Cheers,
Richard

-----
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.

-- 
Richard Levitte                         address@hidden
                                        http://richard.levitte.org/

"When I became a man I put away childish things, including
 the fear of childishness and the desire to be very grown up."
                                                -- C.S. Lewis




reply via email to

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