[darcs-users] Re: Retrieving a specific "version" of a file

Mark Stosberg mark at summersault.com
Tue Apr 5 00:32:47 UTC 2005


On 2005-04-02, Steven E. Harris <seh at panix.com> wrote:
> Sometimes I need to get a copy of a controlled file as of some
> previous version or patch, either for the purposes of diffing in a
> separate tool or even just to keep around for some copy-and-paste
> fodder.
>
> CVS allows this with
>
>   cvs (get|co|update) -r<...> -p file > file.copy
>
> BitKeeper allows this with
>
>   bk get -r<...> -p file > file.copy
>
> ClearCase allows this with
>
>   cleartool get -to file.copy file@@<...>
>
> Is there an equivalent recipe for darcs?

I think might work. The logic is "get a diff between the previous
version and the current state, and then apply it as inverse patch":

    cp file file.copy; 
    darcs diff --to-patch=foo file | patch -R file.copy

I tried that just now and works as expected. Notice that I use
"--to-patch" and not  "--from-patch".

"--from-patch" is inclusive, which means if I had used it, I would have
been returned to the version /before/ the one I named.

I'm not sure of the best way to make this more intuitive for darcs.   

    Mark





-- 
http://mark.stosberg.com/ 





More information about the darcs-users mailing list