Mark E. Hamilton wrote:
A fourth approach would be to do the 'cvs update' to merge everything that can be merged successfully, and then use something like this to automatically select one of the two choices in the conflict lines:

#!/bin/bash
for file in $(cvs -q update | egrep '^C' | cut -f2 -d' ')
do
 # Pick one of these two sed commands.

# This will discard the repository changes and keep the project changes
 sed -e '/^=======/,/^>>>>>>>/d' -e '/^<<<<<<</d' ${file} > blarg \
   && mv blarg ${file}

# This will discard the project changes and keep the respository changes
 sed -i -e '/^<<<<<<</,/^=======/d' -e '/^>>>>>>>/d' ${file} > blarg \
   && mv blarg ${file}
done

Whoops, major typo. In the second sed() command DON'T use the '-i' option with the redirect; you'll end up with an empty file. Sorry.


 sed -e '/^<<<<<<</,/^=======/d' -e '/^>>>>>>>/d' ${file} > blarg \
   && mv blarg ${file}

FWIW, if your sed() supports the '-i' option you don't need to do the redirect and move.

--
----------------
Mark E. Hamilton
Orion International Technologies, Inc.
Sandia National Laboratory, NM.
844-7666



_______________________________________________
Info-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/info-cvs

Reply via email to