mercurial/dispatch.py
changeset 28263 59509c6724c7
parent 28081 a6344df5108e
child 28313 aa73d6a5d9ea
equal deleted inserted replaced
28262:53dc4aada2d9 28263:59509c6724c7
   683     # run post-hook, passing command result
   683     # run post-hook, passing command result
   684     hook.hook(lui, repo, "post-%s" % cmd, False, args=" ".join(fullargs),
   684     hook.hook(lui, repo, "post-%s" % cmd, False, args=" ".join(fullargs),
   685               result=ret, pats=cmdpats, opts=cmdoptions)
   685               result=ret, pats=cmdpats, opts=cmdoptions)
   686     return ret
   686     return ret
   687 
   687 
   688 def _getlocal(ui, rpath):
   688 def _getlocal(ui, rpath, wd=None):
   689     """Return (path, local ui object) for the given target path.
   689     """Return (path, local ui object) for the given target path.
   690 
   690 
   691     Takes paths in [cwd]/.hg/hgrc into account."
   691     Takes paths in [cwd]/.hg/hgrc into account."
   692     """
   692     """
   693     try:
   693     if wd is None:
   694         wd = os.getcwd()
   694         try:
   695     except OSError as e:
   695             wd = os.getcwd()
   696         raise error.Abort(_("error getting current working directory: %s") %
   696         except OSError as e:
   697                          e.strerror)
   697             raise error.Abort(_("error getting current working directory: %s") %
       
   698                               e.strerror)
   698     path = cmdutil.findrepo(wd) or ""
   699     path = cmdutil.findrepo(wd) or ""
   699     if not path:
   700     if not path:
   700         lui = ui
   701         lui = ui
   701     else:
   702     else:
   702         lui = ui.copy()
   703         lui = ui.copy()