From 6adbb3c99fe1434ab4f28879f314c81e5f04d32b Mon Sep 17 00:00:00 2001 From: Nicolas Dumazet Date: Sat, 22 Aug 2009 15:47:03 +0200 Subject: [PATCH] util: canonpath: simplify logic if root == os.sep, then endswithsep(root) is True as well: one test is enough --- mercurial/util.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mercurial/util.py b/mercurial/util.py index 0a0a2249ae..0a4d4e480e 100644 --- a/mercurial/util.py +++ b/mercurial/util.py @@ -266,9 +266,7 @@ def pathto(root, n1, n2): def canonpath(root, cwd, myname): """return the canonical path of myname, given cwd and root""" - if root == os.sep: - rootsep = os.sep - elif endswithsep(root): + if endswithsep(root): rootsep = root else: rootsep = root + os.sep