Hello!

I have written a small patch that makes avail and integrated accept a URL as their PATH argument. No test case yet. I just wanted to show the patch early so that I might get some comments on the small changes it introduces. I took Giovanni's advice and made the ability to accept an URL as PATH argument a flag in the command table.

:.:: mattias
Index: svnmerge.py
===================================================================
--- svnmerge.py (revision 19623)
+++ svnmerge.py (working copy)
@@ -1262,7 +1262,8 @@
 class CommandOpts:
     class Cmd:
         def __init__(self, *args):
-            self.name, self.func, self.usage, self.help, self.opts = args
+            self.name, self.func, self.usage, self.help, self.accepts_url, \
+            self.opts = args
         def short_help(self):
             return self.help.split(".")[0]
         def __str__(self):
@@ -1299,6 +1300,7 @@
             "help [COMMAND]",
             "Display help for a specific command. If COMMAND is omitted, "
             "display brief command description.",
+            False,
             [])
 
     def _cmd_help(self, cmd=None, *args):
@@ -1533,6 +1535,7 @@
     current working directory (searching back for the branch point); in this
     case, %s assumes that no revision has been integrated yet since
     the branch point (unless you teach it with --revision).""" % NAME,
+    False,
     [
         "-f", "-r", # import common opts
     ]),
@@ -1551,6 +1554,7 @@
     originated in the branch itself!).  svnmerge can not show these
     so-called "reflected" revisions if you specify the --bidirectional
     or -b command line option.""",
+    True,
     [
         Option("-A", "--all",
                dest="avail-showwhat",
@@ -1581,6 +1585,7 @@
     """Show merged revisions available for PATH as a revision list.
     If --revision is given, the revisions shown will be limited to
     those also specified in the option.""",
+    True,
     [
         Option("-d", "--diff",
                dest="integrated-display",
@@ -1615,6 +1620,7 @@
     already happened, so that it can record it and not offer that
     revision for merge anymore.  Conversely, when there are revisions
     which should not be merged, use '%s block'.""" % (NAME, NAME),
+    False,
     [
         "-b", "-f", "-r", "-S", "-M", # import common opts
     ]),
@@ -1629,6 +1635,7 @@
     into the branch.  Instead, use '%s merge --record-only', which
     records that a merge happened (as opposed to a merge which should
     not happen).""" % NAME,
+    False,
     [
         "-f", "-r", "-S", # import common opts
     ]),
@@ -1637,6 +1644,7 @@
     "unblock [OPTION...] [PATH]",
     """Revert the effect of '%s block'. If --revision is omitted, all the
     blocked revisions are unblocked""" % NAME,
+    False,
     [
         "-f", "-r", "-S", # import common opts
     ]),
@@ -1676,7 +1684,10 @@
         assert False, "command not handled: %s" % cmd
 
     # Validate branch_dir
-    if not is_wc(branch_dir):
+    print str(cmd) + " " + str(cmd.accepts_url)
+    if cmd.accepts_url and not (is_url(branch_dir) or is_wc(branch_dir)):
+        error('"%s" is not a subversion working directory or URL' % branch_dir)
+    elif not cmd.accepts_url and not is_wc(branch_dir):
         error('"%s" is not a subversion working directory' % branch_dir)
 
     # Extract the integration info for the branch_dir
_______________________________________________
Svnmerge mailing list
[email protected]
http://www.orcaware.com/mailman/listinfo/svnmerge

Reply via email to