parameters: (hgHost, repoPath, protocol='https', revision=None,
                  filename=None)
docstring: construct a valid hg url from a base hg url (hg.mozilla.org),
      repoPath, revision and possible filename
docstring_summary: construct a valid hg url from a base hg url (hg.mozilla.org),
      repoPath, revision and possible filename
docstring_tokens: construct a valid hg url from a base hg url ( hg . mozilla . org ) repoPath revision and possible filename
function: def make_hg_url(hgHost, repoPath, protocol='https', revision=None,
                  filename=None):
      """construct a valid hg url from a base hg url (hg.mozilla.org),
      repoPath, revision and possible filename"""
      base = '%s://%s' % (protocol, hgHost)
      repo = '/'.join(p.strip('/') for p in [base, repoPath])
      if not filename:
          if not revision:
              return repo
          else:
              return '/'.join([p.strip('/') for p in [repo, 'rev', revision]])
      else:
          assert revision
          return '/'.join([p.strip('/') for p in [repo, 'raw-file', revision, filename]])
function_tokens: def make_hg_url ( hgHost , repoPath , protocol = 'https' , revision = None , filename = None ) : base = '%s://%s' % ( protocol , hgHost ) repo = '/' . join ( p . strip ( '/' ) for p in [ base , repoPath ] ) if not filename : if not revision : return repo else : return '/' . join ( [ p . strip ( '/' ) for p in [ repo , 'rev' , revision ] ] ) else : assert revision return '/' . join ( [ p . strip ( '/' ) for p in [ repo , 'raw-file' , revision , filename ] ] )