[PATCH] context: name files relative to cwd in warning messages

Yuya Nishihara yuya at tcha.org
Fri Jul 14 09:50:04 EDT 2017


On Tue, 11 Jul 2017 23:33:08 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1499748029 14400
> #      Tue Jul 11 00:40:29 2017 -0400
> # Node ID e100fdb7e94d0adec9f14254e096e5757fc2f327
> # Parent  6a82448038935002b24af767829d3a27908050ef
> context: name files relative to cwd in warning messages

Sounds good to me. One nit.

> --- a/mercurial/context.py
> +++ b/mercurial/context.py
> @@ -1518,17 +1518,20 @@
>                  (missing and self.deleted()))
>  
>      def add(self, list, prefix=""):
> -        join = lambda f: os.path.join(prefix, f)
>          with self._repo.wlock():
>              ui, ds = self._repo.ui, self._repo.dirstate
> +            uipath = lambda f: ds.pathto(prefix + '/' + f if prefix else f)

pathutil.join() could be used in place of if/else.


More information about the Mercurial-devel mailing list