[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] [bug #29927] mtn clone removes existing bookkeeping
From: |
Thomas Keller |
Subject: |
Re: [Monotone-devel] [bug #29927] mtn clone removes existing bookkeeping directory on failure |
Date: |
Fri, 21 May 2010 14:00:50 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.9) Gecko/20100317 SUSE/3.0.4-1.1.1 Lightning/1.0b2pre Thunderbird/3.0.4 |
Am 21.05.2010 11:51, schrieb Stephen Leake:
> Thomas Keller <address@hidden> writes:
>
>> mtn clone allows to be executed in ".". When this directory contains a
>> monotone bookkeeping directory, the cloning is aborted, but the original _MTN
>> directory is also removed!
>>
>> ...
>>
>> I can think of two ways to fix this bug:
>>
>> a) check for an existing bookkeeping directory separately before the cleanup
>> helper is created
>>
>> b) don't allow setup / clone to be called for an existing directory
>
> Does "exising directory" include "nested directory"? For example:
>
> cd root
> setup project1
> cd project1
> mkdir project2
> cd project2
> setup .
>
> Is that final 'setup' forbidden by b)? or is only this forbidden:
>
> cd root
> setup project1
> cd project1
> setup .
>
> This latter case should definitely be forbidden, and for clone and
> checkout as well; it is certainly an error to replace an existing
> workspace by another one.
>
> The nested case is probably a user error (it always is for me), but
> there's no intrinsic reason mtn can't support it.
Sorry, got your email too late - you did not reply on the bug ;)
I fixed it with the a) solution for now, so nothing is changed in
respect to the other behaviour.
>> On a related note - clone uses the branch name as directory name for the
>> clone if no directory has been given explicitely while setup defaults to the
>> current directory (".") - do we want to unify these? I'd propose that both
>> fall back to the branch name as directory name.
>
> I think the use cases are significantly different. clone is remote
> checkout; both populate a new workspace with an existing branch, and
> both use the branch name as the default directory name.
>
> setup has two use cases:
>
> 1) convert an existing directory directory tree into a mtn workspace,
> often on a new branch, unrelated to any existing branch
>
> 2) create a new empty workspace, presumably on a new branch
>
> For use case 1), "." as the default makes sense. For use case 2, the
> branch name makes sense.
For use case 1) its not always only about "converting" an existing
directory - you could give setup also a not existing directory and it
would happily create and initialize that, just as clone does. So my
suggestion was actually: _If_ no directory is given to setup, don't fall
back to ".", but to the branch name the user entered, i.e. force him to
give monotone a "." (or any other path) to convert an existing directory
to a new workspace.
I, on the other hand, tend to create new workspaces now and then, for
smaller projects or for testing reasons and it bugged me a couple of
times that monotone created a bookkeeping directory for a new branch
just because I forgot to give it an explicit path. But hey, maybe that
is just me... I won't argue this issue to death with anybody :)
Thomas.
--
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en
signature.asc
Description: OpenPGP digital signature