From magnus.ihse.bursie at oracle.com Mon Jan 16 13:24:16 2017 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Mon, 16 Jan 2017 14:24:16 +0100 Subject: RFR: CODETOOLS-7901819 hg tstatus does not work well with pager In-Reply-To: <6d4030ad-0bbc-c549-df68-0fa34e42ef87@oracle.com> References: <3bc24d93-b3ca-b637-a64a-222a06fd5547@oracle.com> <494517750.79678.1479927110332@privateemail.com> <6d4030ad-0bbc-c549-df68-0fa34e42ef87@oracle.com> Message-ID: On 2016-12-07 13:53, Magnus Ihse Bursie wrote: > On 2016-11-23 19:51, John Coomes wrote: >>> On November 23, 2016 at 1:16 AM Magnus Ihse Bursie >>> wrote: >>> >>> Any reviewers on this? >> Hi Magnus, >> >> I think it's better to call ui.flush() after running a command to get >> the right ordering. The patch below does that in both _docmd1() and >> _docmd2(). Feel free to push w/me as reviewer. > > I tried that but I do still not have write access to the hg repo. :-( John, Can you push this? Do you know what the formal hurdles are that needs to be overcome for me to get committer status for the hgtrees project? /Magnus > > /Magnus > >> >> -John >> >> commands: flush output after running a command >> >> diff --git a/trees.py b/trees.py >> --- a/trees.py >> +++ b/trees.py >> @@ -241,6 +241,7 @@ >> if o[1] in cmdopts: >> del cmdopts[o[1]] >> trc = cmd(ui, repo, *args, **cmdopts) >> + ui.flush() >> rc = trc != None and trc or 0 >> for subtree in _subtreelist(ui, repo, opts): >> ui.status('\n') >> @@ -256,6 +257,7 @@ >> >> ui.status('[%s]:\n' % repo.root) >> trc = cmd(ui, repo, remote, **opts) >> + ui.flush() >> rc = trc != None and trc or 0 >> for subtree in _subtreelist(ui, repo, opts): >> ui.status('\n') >> >>> /Magnus >>> >>> On 2016-10-12 11:57, Magnus Ihse Bursie wrote: >>> >>>> When running hg tstatus using the pager, the separating newlines gets >>>> presented in incorrect order (for somewhat unclear reasons). >>>> >>>> The fix is however trivial, just move the printing of the newline >>>> slightly. >>>> >>>> Bug: https://bugs.openjdk.java.net/browse/CODETOOLS-7901819 >>>> Patch inline: >>>> diff --git a/trees.py b/trees.py >>>> --- a/trees.py >>>> +++ b/trees.py >>>> @@ -241,9 +241,9 @@ >>>> if o[1] in cmdopts: >>>> del cmdopts[o[1]] >>>> trc = cmd(ui, repo, *args, **cmdopts) >>>> >>>> * ui.status('\n') >>>> rc = trc != None and trc or 0 >>>> for subtree in _subtreelist(ui, repo, opts): >>>> >>>> * ui.status('\n') >>>> lr = hg.repository(ui, repo.wjoin(subtree)) >>>> trc = _docmd1(cmd, lr.ui, lr, *args, **opts) >>>> rc += trc != None and trc or 0 >>>> >>>> /Magnus >