comparison mercurial/commandserver.py @ 27566:5d6f984c8375

commandserver: reset state of progress bar per command A progress bar is normally disabled in command-server session, but chg can enable it. This patch makes sure the last-print time is measured per command. Otherwise, progress.delay could be ineffective if a progbar was loaded before forking worker process. This patch is corresponding to the following change. https://bitbucket.org/yuja/chg/commits/2dfe3e90b365
author Yuya Nishihara <yuya@tcha.org>
date Mon, 14 Dec 2015 23:50:02 +0900
parents e7937438e3f7
children 5f2a308bac94
comparison
equal deleted inserted replaced
27565:e7937438e3f7 27566:5d6f984c8375
211 repoui = self.repoui.__class__(self.repoui) 211 repoui = self.repoui.__class__(self.repoui)
212 repoui.copy = copiedui.copy # redo copy protection 212 repoui.copy = copiedui.copy # redo copy protection
213 uis.append(repoui) 213 uis.append(repoui)
214 self.repo.ui = self.repo.dirstate._ui = repoui 214 self.repo.ui = self.repo.dirstate._ui = repoui
215 self.repo.invalidateall() 215 self.repo.invalidateall()
216
217 # reset last-print time of progress bar per command
218 # (progbar is singleton, we don't have to do for all uis)
219 if copiedui._progbar:
220 copiedui._progbar.resetstate()
216 221
217 for ui in uis: 222 for ui in uis:
218 # any kind of interaction must use server channels, but chg may 223 # any kind of interaction must use server channels, but chg may
219 # replace channels by fully functional tty files. so nontty is 224 # replace channels by fully functional tty files. so nontty is
220 # enforced only if cin is a channel. 225 # enforced only if cin is a channel.