RFR: CODETOOLS-7901819 hg tstatus does not work well with pager
John Coomes
john at johncoomes.org
Wed Nov 23 18:51:50 UTC 2016
> On November 23, 2016 at 1:16 AM Magnus Ihse Bursie <magnus.ihse.bursie at oracle.com> 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
More information about the hg-tools-dev
mailing list