comparison mercurial/hgweb/webutil.py @ 20033:f962870712da

pathutil: tease out a new library to break an import cycle from canonpath use
author Augie Fackler <raf@durin42.com>
date Wed, 06 Nov 2013 18:19:04 -0500
parents fc1b77db123f
children 52e5aca15f0c
comparison
equal deleted inserted replaced
20032:175c6fd8cacc 20033:f962870712da
5 # 5 #
6 # This software may be used and distributed according to the terms of the 6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version. 7 # GNU General Public License version 2 or any later version.
8 8
9 import os, copy 9 import os, copy
10 from mercurial import match, patch, scmutil, error, ui, util 10 from mercurial import match, patch, error, ui, util, pathutil
11 from mercurial.i18n import _ 11 from mercurial.i18n import _
12 from mercurial.node import hex, nullid 12 from mercurial.node import hex, nullid
13 from common import ErrorResponse 13 from common import ErrorResponse
14 from common import HTTP_NOT_FOUND 14 from common import HTTP_NOT_FOUND
15 import difflib 15 import difflib
194 for t in repo.nodebookmarks(node): 194 for t in repo.nodebookmarks(node):
195 yield tmpl(t1, bookmark=t, **args) 195 yield tmpl(t1, bookmark=t, **args)
196 196
197 def cleanpath(repo, path): 197 def cleanpath(repo, path):
198 path = path.lstrip('/') 198 path = path.lstrip('/')
199 return scmutil.canonpath(repo.root, '', path) 199 return pathutil.canonpath(repo.root, '', path)
200 200
201 def changeidctx (repo, changeid): 201 def changeidctx (repo, changeid):
202 try: 202 try:
203 ctx = repo[changeid] 203 ctx = repo[changeid]
204 except error.RepoError: 204 except error.RepoError: