From magnus.ihse.bursie at oracle.com Wed Nov 23 09:16:16 2016 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Wed, 23 Nov 2016 10:16:16 +0100 Subject: RFR: CODETOOLS-7901819 hg tstatus does not work well with pager In-Reply-To: References: Message-ID: <3bc24d93-b3ca-b637-a64a-222a06fd5547@oracle.com> Any reviewers on this? /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 From john at johncoomes.org Wed Nov 23 18:51:50 2016 From: john at johncoomes.org (John Coomes) Date: Wed, 23 Nov 2016 10:51:50 -0800 (PST) Subject: RFR: CODETOOLS-7901819 hg tstatus does not work well with pager In-Reply-To: <3bc24d93-b3ca-b637-a64a-222a06fd5547@oracle.com> References: <3bc24d93-b3ca-b637-a64a-222a06fd5547@oracle.com> Message-ID: <494517750.79678.1479927110332@privateemail.com> > 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. -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