meld r1192 - trunk/vc



Author: vincele
Date: Sun Mar  1 23:35:36 2009
New Revision: 1192
URL: http://svn.gnome.org/viewvc/meld?rev=1192&view=rev

Log:
Make find_repo_root() OS independent

Don't hardcode '/' as root folder, detect when
we're not walking upper any more and bail out


Modified:
   trunk/vc/_vc.py

Modified: trunk/vc/_vc.py
==============================================================================
--- trunk/vc/_vc.py	(original)
+++ trunk/vc/_vc.py	Sun Mar  1 23:35:36 2009
@@ -91,10 +91,13 @@
         return ["patch","--strip=%i"%self.PATCH_STRIP_NUM,"--reverse","--directory=%s" % workdir]
 
     def find_repo_root(self, start, subdir, raiseError = True):
-        while start != "/":
+        while True:
             if os.path.isdir(os.path.join(start, subdir)):
                 return start
-            start = os.path.dirname(start)
+            tmp = os.path.dirname(start)
+            if tmp == start:
+                break
+            start = tmp
         if raiseError:
             raise ValueError()
         return None



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