[PATCH] chgserver: use global ui instead of repo ui for dispatch.request.ui

Yuya Nishihara yuya at tcha.org
Sun Mar 20 12:13:08 EDT 2016


On Sat, 19 Mar 2016 18:39:12 -0700, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1458239530 0
> #      Thu Mar 17 18:32:10 2016 +0000
> # Node ID cb25e00a2545a07ef9f3842f26450f2a33c0bcd8
> # Parent  9949950664cda68757f4312920c6d33095343e03
> chgserver: use global ui instead of repo ui for dispatch.request.ui

Got pyflakes error. I'll fix this in flight and push to the clowncopter, thanks.

  hgext/chgserver.py:537: undefined name '_renewui'

> @@ -450,13 +451,13 @@
>          """
>          args = self._readlist()
>          try:
> -            self.ui = _renewui(self.ui, args)
> +            self.ui, lui = _loadnewui(self.ui, args)
>          except error.ParseError as inst:
>              dispatch._formatparse(self.ui.warn, inst)
>              self.ui.flush()
>              self.cresult.write('exit 255')
>              return
> -        newhash = hashstate.fromui(self.ui, self.hashstate.mtimepaths)
> +        newhash = hashstate.fromui(lui, self.hashstate.mtimepaths)

This assumes that the initial self.hashstate is calculated from repo.ui, which
implies self.ui was initially a repo.ui (~= lui).

If we change "hg serve --cmdserver chgunix" not to load repo, we'll have to
get "lui" in some way to calculate the initial hash.


More information about the Mercurial-devel mailing list