meld r1020 - trunk/vc



Author: stevek
Date: Mon Jul  7 19:54:49 2008
New Revision: 1020
URL: http://svn.gnome.org/viewvc/meld?rev=1020&view=rev

Log:
Improve VC Detection. Bug 541281 Christos Trochalakis

Modified:
   trunk/vc/__init__.py

Modified: trunk/vc/__init__.py
==============================================================================
--- trunk/vc/__init__.py	(original)
+++ trunk/vc/__init__.py	Mon Jul  7 19:54:49 2008
@@ -35,9 +35,15 @@
 _plugins = load_plugins()
 
 def Vc(location):
+    vcs = []
     for plugin in _plugins:
         try:
-            return plugin.Vc(location)
+            vcs.append(plugin.Vc(location))
         except ValueError:
             pass
-    return _null.Vc(location)
+
+    if not vcs:
+        return _null.Vc(location)
+
+    #Pick the Vc with the longest repo root
+    return max(vcs, key=lambda repo: len(repo.root))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]