[Svnmerge] [PATCH] Add an option to ignore ancestry

Pazu pazu at pazu.com.br
Fri Dec 8 05:17:10 PST 2006


The following patch adds an option to pass '--ignore-ancestry' when calling 'svn
merge'.

Cheers,

-- Pazu

--- svnmerge-old    2006-12-07 20:49:16.000000000 -0200
+++ svnmerge    2006-12-08 10:54:42.000000000 -0200
@@ -1116,6 +1116,7 @@

     blocked_revs = get_blocked_revs(branch_dir, opts["source-path"])
     merged_revs = opts["merged-revs"]
+    ignore_ancestry = opts["ignore-ancestry"]

     # Show what we're doing
     if opts["verbose"]:  # just to avoid useless calculations
@@ -1128,6 +1129,8 @@
             report('memorizing reflected revision(s): %s' % reflected_revs)
         if blocked_revs & revs:
             report('skipping blocked revisions(s): %s' % (blocked_revs & revs))
+        if ignore_ancestry:
+            report('ignoring ancestry')

     # Compute final merge set.
     revs = revs - merged_revs - blocked_revs - reflected_revs - phantom_revs
@@ -1163,8 +1166,8 @@

         if not record_only:
             # Do the merge
-            svn_command("merge -r %d:%d %s %s" % \
-                        (start - 1, end, opts["source-url"], branch_dir))
+            svn_command("merge %s-r %d:%d %s %s" % \
+                        (ignore_ancestry and "--ignore-ancestry " or "", start 

     # Write out commit message if desired
     if opts["commit-file"]:
@@ -1289,6 +1292,7 @@
         error(err_str)

     record_only = opts["record-only"]
+    ignore_ancestry = opts["ignore-ancestry"]

     if record_only:
         report('recording rollback of revision(s) %s from "%s"' %
@@ -1307,8 +1311,8 @@
     for start, end in rollback_intervals:
         if not record_only:
             # Do the merge
-            svn_command("merge -r %d:%d %s %s" % \
-                        (end, start - 1, opts["source-url"], branch_dir))
+            svn_command("merge %s-r %d:%d %s %s" % \
+                        (ignore_ancestry and "--ignore-ancestry " or "", end, s

     # Write out commit message if desired
     # calculate the phantom revs first
@@ -1804,6 +1808,9 @@
     which should not be merged, use '%s block'.""" % (NAME, NAME),
     [
         "-b", "-f", "-r", "-S", "-M", # import common opts
+        Option("-I", "--ignore-ancestry",
+           default=False,
+           help="pass '--ignore-ancestry' to svn merge"),
     ]),

     "block": (action_block,





More information about the Svnmerge mailing list