[PATCH 2 of 5] cmdserver: assign repo.baseui before running commands

Idan Kamara idankk86 at gmail.com
Fri Jun 24 11:51:00 CDT 2011


# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1308933857 -10800
# Branch stable
# Node ID 469e64e3674f4cf54a181dcbf85826e14313e45c
# Parent  63dca9aa6e15cf7d42e4018e73d016f3db0746d8
cmdserver: assign repo.baseui before running commands

There are places in the code that use localrepository.baseui (see hg.remoteui),
we need the ui descriptors (and possibly other things) to be set
correctly on it, so output written to the remoteui descriptors ends up at the
right place.

Before this change, tests such as 'test-bookmarks-pushpull.t' didn't work.

diff -r 63dca9aa6e15 -r 469e64e3674f mercurial/commandserver.py
--- a/mercurial/commandserver.py	Fri Jun 24 19:43:59 2011 +0300
+++ b/mercurial/commandserver.py	Fri Jun 24 19:44:17 2011 +0300
@@ -179,8 +179,11 @@
 
         # copy the uis so changes (e.g. --config or --verbose) don't
         # persist between requests
+        copiedui = self.ui.copy()
+        self.repo.baseui = copiedui
         self.repo.ui = self.repo.dirstate._ui = self.repoui.copy()
-        req = dispatch.request(args, self.ui.copy(), self.repo, self.cin,
+
+        req = dispatch.request(args, copiedui, self.repo, self.cin,
                                self.cout, self.cerr)
 
         ret = dispatch.dispatch(req) or 0 # might return None


More information about the Mercurial-devel mailing list