index-prop 458 B

1234567891011121314151617181920212223242526
  1. #! /usr/bin/perl -wi
  2. # Fix up the output of cvs diff -c so that it works with patch.
  3. # We do this by propagating the full pathname from the Index: line
  4. # into the diff itself.
  5. #
  6. # Thrown together by Jason Merrill <jason@cygnus.com>
  7. while (<>)
  8. {
  9. if (/^Index: (.*)/)
  10. {
  11. $full = $1;
  12. print;
  13. for (1..7)
  14. {
  15. $_ = <>;
  16. s/^([-+*]{3}) [^\t]+\t/$1 $full\t/
  17. unless m{ /dev/null\t};
  18. print;
  19. }
  20. }
  21. else
  22. {
  23. print;
  24. }
  25. }