[darcs-users] Re: how to get back deleted files in working copy?

Magnus Therning magnus at therning.org
Thu Feb 1 01:00:16 UTC 2007


On Wed, Jan 31, 2007 at 10:19:08 +0100, Peter Hercek wrote:
>Hi Magnus,
>
>this is what I meant by doing it manually:
>
>status:0 peter at ubimg [1163] ~/test/data
>% darcs query manifest
>./data/conv.ml
>./data/rand.ml
>status:0 peter at ubimg [1164] ~/test/data
>% darcs whatsnew -s
>M ./data/conv.ml -8 +17
>status:0 peter at ubimg [1165] ~/test/data
>% rm rand.ml
>status:0 peter at ubimg [1166] ~/test/data
>% darcs whatsnew -s
>M ./data/conv.ml -8 +17
>R ./data/rand.ml
>status:0 peter at ubimg [1167] ~/test/data
>% darcs revert
>hunk ./data/conv.ml 80
>  ... hunk data cut off ...
>Shall I revert this change? (1/?)  [ynWsfqadjkc], or ? for help: n
>hunk ./data/conv.ml 83
>  ... hunk data cut off ...
>Shall I revert this change? (2/?)  [ynWsfqadjkc], or ? for help: n
>hunk ./data/rand.ml 1
>  ... hunk data cut off ...
>Shall I revert this change? (3/?)  [ynWsfqadjkc], or ? for help: y
>Do you really want to revert these changes? y
>Finished reverting.
>status:0 peter at ubimg [1168] ~/test/data
>% darcs whatnew -s
>M ./data/conv.ml -8 +17
>status:0 peter at ubimg [1169] ~/test/data
>%
>
>Thanks for the tip. I can write some script which pulls data
> from whatsnew and puts deleted filenames on the command line
> of darcs revert. Not worth for the example above but I sometimes
> need to do it for tens of deleted files while preserving a lot
> of normal changes. Not as easy as 'svn up -r base' but good
> enough.

With a decent shell something along these lines should work (no, I
haven't tested it):

 % darcs revert -a $(darcs w -s | grep '^R' | cut -f 2 -d ' ')

/M

-- 
Magnus Therning                             (OpenPGP: 0xAB4DFBA4)
magnus at therning.org             Jabber: magnus.therning at gmail.com
http://therning.org/magnus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.osuosl.org/pipermail/darcs-users/attachments/20070201/1bb5c607/attachment.pgp 


More information about the darcs-users mailing list