logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

[darcs #435] "darcs changes --pipe -pPATHNAME", inverse of "darcs record --: msg#00047

Subject: [darcs #435] "darcs changes --pipe -pPATHNAME", inverse of "darcs record --pipe"
Thu Jun 09 12:15:06 2005: New ticket: 435.
Transaction: Ticket created by zooko
       Queue: Darcs
     Subject: "darcs changes --pipe -pPATHNAME", inverse of "darcs record 
--pipe"
       Owner: Nobody
  Requestors: zooko@xxxxxxxxx
      Status: new
 Ticket <URL: http://bugs.darcs.net/.//Ticket/Display.html?id=435 >

I wish that darcs had a switch so that "darcs changes -pPATCHNAME" would
emit metadata that would be understood if piped into "darcs record
--pipe".  Therefore the following bash script would textually apply a
patch from one darcs repo to another:

cd repo1; darcs diff -u pPATCHNAME | ( cd ../repo2 ; patch -p0 ) ; darcs
changes --pipe -pPATCHNAME | ( cd ../repos2 ; darcs record --pipe --all )

This would be limited by the limits of "patch", of course, for example
file names wouldn't work (thanks to Ian Lynagh for pointing that out).

The reason to do a textual application instread of a real darcs pull is
that repo1 and repo2 contain doppleganger patches, so darcs pull will
hang (until new-conflict-magic works).

This might also facilitate other kinds of scripting.  (I've just spent
some time struggling to parse the output of "darcs changes -pPATCHNAME"
with bash and/or Python, and I've given up.  It's clearly possible, but
it's just too much hassle for quick scripting jobs.)

Judging from my own, admittedly anecdotal, experience, and from
darcs-users mailing list, this sort of hack is frequently needed.


<Prev in Thread] Current Thread [Next in Thread>