[meld/meld-1-8] vc: Don't error out when we get only non-walking VCs



commit 8da9c84dafe17c099ff50f8b16e4c9f706bc4a72
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Jan 18 08:13:51 2014 +1000

    vc: Don't error out when we get only non-walking VCs

 meld/vc/__init__.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/meld/vc/__init__.py b/meld/vc/__init__.py
index 740fcb3..dc78376 100644
--- a/meld/vc/__init__.py
+++ b/meld/vc/__init__.py
@@ -83,7 +83,8 @@ def get_vcs(location):
     # Choose the deepest root we find, unless it's from a VC that
     # doesn't walk; these can be spurious as the real root may be
     # much higher up in the tree.
-    max_depth = max(len(vc.root) for vc in vcs if vc.VC_ROOT_WALK)
+    root_walk_lengths = [len(vc.root) for vc in vcs if vc.VC_ROOT_WALK]
+    max_depth = max(root_walk_lengths or [0])
     vcs = [vc for vc in vcs if not vc.VC_ROOT_WALK or
            (len(vc.root) == max_depth and vc.VC_ROOT_WALK)]
 


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