[darcs-users] What does darcs convert . do?

Trent W. Buck trentbuck at gmail.com
Tue Sep 30 02:20:15 UTC 2008


Mads Lindstrøm <mads_lindstroem at yahoo.dk> writes:

> I wanted to convert a darcs 1 repo to darcs 2 format and I was feeling
> adventures, so I did (ok, I had backed the repo up before trying):
>
>> darcs convert .
>
> But it seemed to not change my repo. It still says it is a darcs 1 repo.
> So what did the command do?

darcs convert creates a new directory containing the repository in
darcs-2 format.  AFAIK it doesn't make any changes to the source
directory.  The normal way of using it would be like this:

    $ # we make an old-style repo "foo" to demonstrate:
    $ darcs init --repodir foo --old-fashioned-inventory


    $ darcs convert foo
    WARNING: [...]
    Directory '/tmp/with-temp-dir.qVvdsj/foo' already exists, creating repository as '/tmp/with-temp-dir.qVvdsj/foo_0'
    Finished converting.
    $ ls
    foo  foo_0

The darcs-2 repo is now in foo_0.

If we do it the expected way, which is how you did it, we get this:

    $ darcs init --repodir foo --old-fashioned-inventory
    $ cd foo
    $ darcs convert .
    WARNING: [...]
    Finished converting.
    $ ls
    _darcs	foo
    $ ls foo
    _darcs

Oops!  Now we have the darcs-2 repo inside the darcs-1 repo.  You can
fix this by just doing "mv foo ../foo_0", but I agree it's not obvious
what has happened.

Note that this is the confusing behaviour as "darcs get .":

    $ darcs init --repodir foo
    $ cd foo
    $ darcs get .
    Finished getting.
    $ ls
    _darcs	foo



More information about the darcs-users mailing list