[PATCH 4 of 4] verify-cvs2svn: give user control over CVS keyword expansion

Greg Ward <[email protected]>
Newsgroups gmane.comp.version-control.subversion.cvs2svn.devel
Message-ID <02974eb2142c6d535018.1250643310@davros>
with --keyword-opt and --suppress-keywords options.

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2385056

To unsubscribe from this discussion, e-mail: [[email protected]].
verify-keyword-opts.patch (text/x-patch, 2 KB)
# HG changeset patch
# User Greg Ward <[email protected]>
# Date 1249496795 14400
# Node ID 02974eb2142c6d535018ca6b8d1bfe6cb6765e2d
# Parent  40b57caea9462893431a33258c6424ea265492a4
verify-cvs2svn: give user control over CVS keyword expansion
with --keyword-opt and --suppress-keywords options.

diff --git a/contrib/verify-cvs2svn.py b/contrib/verify-cvs2svn.py
--- a/contrib/verify-cvs2svn.py
+++ b/contrib/verify-cvs2svn.py
@@ -81,7 +81,7 @@
   def __str__(self):
     return os.path.basename(self.cvsroot)
 
-  def export(self, dest_path, rev=None):
+  def export(self, dest_path, rev=None, keyword_opt=None):
     """Export revision REV to DEST_PATH where REV can be None to export
     the HEAD revision, or any valid CVS revision string to export that
     revision."""
@@ -91,6 +91,8 @@
       cmd.extend([ '-r', rev ])
     else:
       cmd.extend([ '-D', 'now' ])
+    if keyword_opt:
+      cmd.append(keyword_opt)
     cmd.extend([ '-d', dest_path, self.module ])
     (output, status) = pipe(cmd)
     if status or output:
@@ -375,7 +377,7 @@
     cvslabel = None
 
   try:
-    cvsrepos.export(cvs_export_dir, cvslabel)
+    cvsrepos.export(cvs_export_dir, cvslabel, ctx.keyword_opt)
     if kind == 'trunk':
       verifyrepos.export_trunk(vrf_export_dir)
     elif kind == 'tag':
@@ -469,6 +471,14 @@
   parser.add_option('--git',
                     action='store_const', dest='repos_type', const='git',
                     help='assume verify-repos is git (not implemented!)')
+  parser.add_option('--suppress-keywords',
+                    action='store_const', dest='keyword_opt', const='-kk',
+                    help='suppress CVS keyword expansion '
+                         '(equivalent to --keyword-opt=-kk)')
+  parser.add_option('--keyword-opt',
+                    metavar='OPT',
+                    help='control CVS keyword expansion by adding OPT to '
+                         'cvs export command line')
 
   parser.set_defaults(run_diff=False,
                       tmpdir='',
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.