[yast-commit] r50392 - /branches/tmp/jsrain/config-history/src/ConfigHistory.ycp
Author: jsrain Date: Wed Aug 27 09:33:28 2008 New Revision: 50392 URL: http://svn.opensuse.org/viewcvs/yast?rev=50392&view=rev Log: added support for manually adding files known to be modified into repository Modified: branches/tmp/jsrain/config-history/src/ConfigHistory.ycp Modified: branches/tmp/jsrain/config-history/src/ConfigHistory.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsrain/config-history/src/ConfigHistory.ycp?rev=50392&r1=50391&r2=50392&view=diff ============================================================================== --- branches/tmp/jsrain/config-history/src/ConfigHistory.ycp (original) +++ branches/tmp/jsrain/config-history/src/ConfigHistory.ycp Wed Aug 27 09:33:28 2008 @@ -418,7 +418,44 @@ return true; } - +/** + * Initialize specified files for version control; useful when + * not having whole directory under version control, but only + * relevant files + * @param files a list of files to add to repo (resp. ensure they are in) + * @return boolean true on success, false otherwise + */ +global boolean InitFiles(list<string> files) { + if (size (files) == 0) + return true; + if (! UseSvn()) + return true; + if (Recursive()) + return true; + if (nested_transactions == 0) + { + y2error ("InitFiles called before prior initialization"); + return false; + } + string filelist = mergestring (files, " "); + map out = (map)SCR::Execute (.target.bash_output, sformat ( + "svn add %1", filelist)); + if (out["exit"]:-1 != 0) { + y2error ("Failed to schedule files %1 for addition: %2", filelist, out["stderr"]:""); + return false; + } + boolean success = true; + foreach (string dir, log_directories, { + out = (map)SCR::Execute (.target.bash_output, sformat ( + "cd %1; svn ci -m 'Initial check-in of files to be changed'", dir)); + if (out["exit"]:-1 != 0) + { + y2error ("Failed to commit changes to %1: %2", dir, out["exit"]:""); + success = false; + } + }); + return success; +} /* EOF */ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsrain@svn.opensuse.org