diff -r 83785bb56062 -r 9ee25d7b1aed mercurial/posix.py --- a/mercurial/posix.py Fri Sep 14 12:07:33 2012 -0700 +++ b/mercurial/posix.py Fri Sep 14 12:08:17 2012 -0700 @@ -20,6 +20,16 @@ umask = os.umask(0) os.umask(umask) +def split(p): + '''Same as os.path.split, but faster''' + ht = p.rsplit('/', 1) + if len(ht) == 1: + return '', p + nh = ht[0].rstrip('/') + if nh: + return nh, ht[1] + return ht + def openhardlinks(): '''return true if it is safe to hold open file handles to hardlinks''' return True