mercurial/cmdutil.py
changeset 10402 d216fa04e48a
parent 10401 6252852b4332
child 10463 5ddde896a19d
equal deleted inserted replaced
10401:6252852b4332 10402:d216fa04e48a
    59 
    59 
    60     if choice:
    60     if choice:
    61         return choice.values()[0]
    61         return choice.values()[0]
    62 
    62 
    63     raise error.UnknownCommand(cmd)
    63     raise error.UnknownCommand(cmd)
       
    64 
       
    65 def findrepo(p):
       
    66     while not os.path.isdir(os.path.join(p, ".hg")):
       
    67         oldp, p = p, os.path.dirname(p)
       
    68         if p == oldp:
       
    69             return None
       
    70 
       
    71     return p
    64 
    72 
    65 def bail_if_changed(repo):
    73 def bail_if_changed(repo):
    66     if repo.dirstate.parents()[1] != nullid:
    74     if repo.dirstate.parents()[1] != nullid:
    67         raise util.Abort(_('outstanding uncommitted merge'))
    75         raise util.Abort(_('outstanding uncommitted merge'))
    68     modified, added, removed, deleted = repo.status()[:4]
    76     modified, added, removed, deleted = repo.status()[:4]