سؤال

I have a list of files in my current working copy that have been modified locally. There are about 50 files that have been changed.

I am using the following command to copy files that have been modified in subversion to a folder called /backup. Is there a way to do this but maintain the directories they are in? So it would do something similar to exporting a SVN diff of files. For example if I changed a file called /usr/lib/SPL/RFC.php then it would copy the usr/lib/SPL directory to backup also.

cp `svn st | ack '^M' | cut -b 8-` backup
هل كانت مفيدة؟

المحلول

It looks strange, but it is really easy to copy files with tar. E.g.

tar -cf - $( svn st | ack '^M' | cut -b 8- ) |
tar -C /backup -xf -

نصائح أخرى

Why not create a patch of your changes? That way you have one file containing all of your changes which you can timestamp in the name - something like 2012-05-28-17-30-00-UnitTestChanges.patch, one per day.

Then you can roll up your changes to a fresh checkout once you're ready, and then commit them.

FYI: Subversion 1.8 should have checkpointing / shelving (which is what you seem to want to do), but that's a long way off, and might only be added in Subversion 1.9.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top