[darcs-devel] [darcs #396] 'darcs record' should respect registered files

Karel Gardas kgardas at objectsecurity.com
Thu May 19 02:07:23 PDT 2005


On Wed, 18 May 2005, via RT wrote:

> For example:-
> $ mkdir foo
> $ cd foo
> $ darcs initialize
> $ touch bar frotz
> $ darcs add bar frotz
> $ darcs record --patch-name "add bar and frotz" --all bar frotz
> Recording changes in "bar" "frotz":
> Finished recording patch 'add bar and frotz'
> $ rm bar frotz
> $ darcs whatsnew --summary
> R ./bar
> R ./frotz
> $ darcs record --patch-name "remove bar" --all bar
> Non existent files or directories: "bar"
> darcs failed:  None of the files you specified exist!
> $
>
>
> The last 'darcs record' should have worked despite the non-existance of
> bar, since it was already a known file.

This is duplicate of PR#395. Darcs provides "remove" command for removing 
files/directories from the repository w/o actually removing them. IMHO add 
and remove commands are semanticaly the same, i.e. file is created by some 
external command, file exists outside the repo and it is added to the repo 
by add command, file exists outside and inside the repo and it is removed 
from the repo by remove command and finally file is removed from the 
filesystem by some external command. Here automatic detection of file 
removal in record does not IMHO fit well into the scheme. Yes, darcs 
record might automatically looks for added file(s) w/o a need to invoke 
add command, but for this AFAIK you still need to use --look-for-adds 
parameter.

My proposal is:
1) add --look-for-removes option to record, which will disable file
    existence checking logic

2) change help comment in remove command and omit sentence:
"Otherwise just delete the file or directory, and darcs will notice that it has been removed."

The idea behind my proposal is to make add and remove plus record more 
"symetric".

What do you think about it?

Thanks,
Karel
--
Karel Gardas                  kgardas at objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com




More information about the darcs-devel mailing list