Hi again,

Shaddy Baddah wrote:
...

To that end, I had a quick peek at the code, and determined that this simple patch would be sufficient for allowing URL targets to the avail command.

I hope that you will consider it for inclusion.

I left a print in the patch. Also, I realised that my URL check does not emulate the is_wc() call, in that it ensures branch_dir is targeting a real directory.

So please find an enhanced version of this patch attached.

Regards,
Shaddy

[[[
* svnmerge.py
  (main): allow the use of the avail command against a URL instead of
  the current rigid requirement that a subversion working copy be
  referenced.
Patch by: Shaddy Baddah <[EMAIL PROTECTED]>
]]]
Index: svnmerge.py
===================================================================
--- svnmerge.py	(revision 31771)
+++ svnmerge.py	(working copy)
@@ -2085,7 +2085,23 @@
 
     # Validate branch_dir
     if not is_wc(branch_dir):
-        error('"%s" is not a subversion working directory' % branch_dir)
+        if str(cmd) == "avail":
+            info = None
+            # it should be noted here that svn info does not error exit
+            # if an invalid target is specified to it (as is
+            # intuitive). so the try, except code is not absolutely
+            # necessary. but, I retain it to indicate the intuitive
+            # handling.
+            try:
+                info = get_svninfo(branch_dir)
+            except LaunchError:
+                pass
+            # test that we definitely targeted a subversion directory,
+            # mirroring the purpose of the earlier is_wc() call
+            if info is None or info == {} or info["Node Kind"] != "directory":
+                error('"%s" is neither a valid URL, nor a working directory' % branch_dir)
+        else:
+            error('"%s" is not a subversion working directory' % branch_dir)
 
     # Extract the integration info for the branch_dir
     branch_props = get_merge_props(branch_dir)
_______________________________________________
Svnmerge mailing list
[email protected]
http://www.orcaware.com/mailman/listinfo/svnmerge

Reply via email to