[PATCH 08 of 10] scmutil: use the new faster path split

Bryan O'Sullivan bos at serpentine.com
Thu Sep 13 14:01:21 CDT 2012


# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1347562631 25200
# Node ID 168fa28b4620b30505e8284bcee5a0cf0d0b6338
# Parent  9d1ceb24dc23a965d6df2b14ebca30da59139710
scmutil: use the new faster path split

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -267,7 +267,7 @@
             mode += "b" # for that other OS
 
         nlink = -1
-        dirname, basename = os.path.split(f)
+        dirname, basename = util.split(f)
         # If basename is empty, then the path is malformed because it points
         # to a directory. Let the posixfile() call below raise IOError.
         if basename and mode not in ('r', 'rb'):
@@ -383,7 +383,7 @@
                 name = os.path.join(*rel)
                 auditor(name)
                 return util.pconvert(name)
-            dirname, basename = os.path.split(name)
+            dirname, basename = util.split(name)
             rel.append(basename)
             if dirname == name:
                 break


More information about the Mercurial-devel mailing list