# HG changeset patch # User Nicolas Dumazet # Date 2009-08-22 13:47:03 # Node ID eae98607b3499385dd76e738a7379a409960be19 # Parent 570416319ed30bdb34680e62817cceb82a124d23 util: canonpath: simplify logic if root == os.sep, then endswithsep(root) is True as well: one test is enough diff --git a/mercurial/util.py b/mercurial/util.py --- 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