hgext/githelp.py
changeset 37388 764ada920db5
parent 37123 a8a902d7176e
child 38151 d8bd6a9c64a5
equal deleted inserted replaced
37387:83d537162894 37388:764ada920db5
    24 from mercurial import (
    24 from mercurial import (
    25     encoding,
    25     encoding,
    26     error,
    26     error,
    27     fancyopts,
    27     fancyopts,
    28     registrar,
    28     registrar,
       
    29     scmutil,
    29 )
    30 )
    30 from mercurial.utils import (
    31 from mercurial.utils import (
    31     procutil,
    32     procutil,
    32 )
    33 )
    33 
    34 
   251     The first argument to git checkout can either be a revision or a path. Let's
   252     The first argument to git checkout can either be a revision or a path. Let's
   252     generally assume it's a revision, unless it's obviously a path. There are
   253     generally assume it's a revision, unless it's obviously a path. There are
   253     too many ways to spell revisions in git for us to reasonably catch all of
   254     too many ways to spell revisions in git for us to reasonably catch all of
   254     them, so let's be conservative.
   255     them, so let's be conservative.
   255     """
   256     """
   256     if string in repo:
   257     if scmutil.isrevsymbol(repo, string):
   257         # if it's definitely a revision let's not even check if a file of the
   258         # if it's definitely a revision let's not even check if a file of the
   258         # same name exists.
   259         # same name exists.
   259         return False
   260         return False
   260 
   261 
   261     cwd = repo.getcwd()
   262     cwd = repo.getcwd()