[Bug 6354] New: AssertionError when pushing or pulling with py3 and topics/evolve

2020-06-11 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6354

Bug ID: 6354
   Summary: AssertionError when pushing or pulling with py3 and
topics/evolve
   Product: Mercurial
   Version: 5.4rc0
  Hardware: All
OS: All
Status: UNCONFIRMED
  Severity: bug
  Priority: wish
 Component: evolution
  Assignee: bugzi...@mercurial-scm.org
  Reporter: matt_harbi...@yahoo.com
CC: mercurial-devel@mercurial-scm.org,
pierre-yves.da...@ens-lyon.org
Python Version: ---

Unlike the cache warming stacktrace I filed recently, this didn't go away on
retry.  It occurred with py3 in WSL pushing 3 times and pulling once, but
worked fine with py2 in msys.

There were 4 unrelated (to the topic stack), unstable commits reported by `hg
incoming`.  One was previously pushed and subsequently pruned locally (so I'm
not sure why it was reported on incoming).  The other 3 were commits that were
previously pushed, but I was in the middle of picking that stack and didn't get
to them before attempting to push.

hg push -t metrics_design
Please enter password for encrypted keyring:
pushing to https://vcs.attotech.com/hg/users/bgrove/golang/atto360
searching for changes
** Unknown exception encountered with possibly-broken third-party extension
mercurial_keyring
** which supports versions unknown of Mercurial.
** Please disable mercurial_keyring and try your action again.
** If that fixes the bug please report it to
https://bitbucket.org/Mekk/mercurial_keyring/issues
** Python 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0]
** Mercurial Distributed SCM (version 5.4)
** Extensions loaded: extdiff, evolve, topic, phabricator, rebase, absorb,
blackbox, strip, show, fix, mercurial_keyring
Traceback (most recent call last):
  File "/home/mharbison/.local/bin/hg", line 43, in 
dispatch.run()
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py",
line 112, in run
status = dispatch(req)
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py",
line 298, in dispatch
ret = _runcatch(req) or 0
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py",
line 472, in _runcatch
return _callcatch(ui, _runcatchfunc)
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py",
line 481, in _callcatch
return scmutil.callcatch(ui, func)
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/scmutil.py", line
152, in callcatch
return func()
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py",
line 462, in _runcatchfunc
return _dispatch(req)
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py",
line 1226, in _dispatch
lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py",
line 910, in runcommand
ret = _runcommand(ui, options, cmd, d)
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py",
line 1237, in _runcommand
return cmdfunc()
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py",
line 1223, in 
d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/util.py",
line 1864, in check
return func(*args, **kwargs)
  File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/util.py",
line 1864, in check
return func(*args, **kwargs)
  File
"/home/mharbison/.local/lib/python3.6/site-packages/hgext3rd/topic/__init__.py",
line 1274, in pushoutgoingwrap
return orig(ui, repo, *args, **opts)
  File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/util.py",
line 1864, in check
return func(*args, **kwargs)
  File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/util.py",
line 1864, in check
return func(*args, **kwargs)
  File
"/home/mharbison/.local/lib/python3.6/site-packages/hgext3rd/topic/flow.py",
line 94, in wrappush
return orig(repo, remote, *args, **newargs)
  File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/util.py",
line 1864, in check
return func(*args, **kwargs)
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/commands.py",
line 5666, in push
opargs=opargs,
  File
"/home/mharbison/.local/lib/python3.6/site-packages/hgext3rd/evolve/__init__.py",
line 731, in push
return orig(repo, *args, **opts)
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/exchange.py",
line 651, in push
_pushdiscovery(pushop)
  File
"/home/mharbison/.local/lib/python3.6/site-packages/mercurial/exchange.py",
line 699, in _pushdiscovery
step(pushop)
  File
"/home/mharbison/.local/lib/python3.6/site-packages/hgext3rd/evolve/obsdiscovery.py",
line 827, in newdisco

D8626: memctx: add mergestate method

2020-06-11 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8626

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -2879,6 +2879,9 @@
 
 return scmutil.status(modified, added, removed, [], [], [], [])
 
+def mergestate(self):
+return mergestatemod.memmergestate(self._repo, self)
+
 
 class memfilectx(committablefilectx):
 """memfilectx represents an in-memory file to commit.



To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] hg: copy buffer state to remote ui

2020-06-11 Thread Elmar Bartel
Hello Yuya,

> > +# copy buffer state to the remote ui
> > +if src._buffers:
> > +dst._buffers = src._buffers
> > +dst._bufferstates = src._bufferstates
> > +dst._bufferapplylabels = src._bufferstates[-1][2]
> 
> The state would become inconsistent if you do popbuffer() later on.
Which state: the state of the original ui or the state of
the remote-ui?
Anyway, as long as the ui-buffer interface is correctly used 
(properly matching pushpuffer() and popbuffer()) I cannot
see any state becoming inconsistent.
Furthermore the remote-ui is not accessible from the user
calling pushbuffer() on the original ui. This fact brought
me to the solution which my patch implements.

> [...]
> And this touches the internal of the ui, we'll need some tests so
> the change wouldn't regress.
Is see two things here, which could be tested:
  - the original ui is not changed, beside the desired effect of
having additional content in the buffer.
  - the buffer does contain the content from the actions on the
remoute-ui
Is this the test you suggest?

> It might be even better to add a function to copy ui with
> buffer e.g. ui.copy_sharing_buffer() or ui.copy(share_buffer=True).
I completly agree here.
This is the place where copying things should happen.
And then, remoteui() would just call ui.copy(share_buffer=True).

Nevertheless: the problems you anticipate (and I do not yet see)
are then moved to the ui.copy() function. Since what can really
be done by ui.copy(share_buffer==True)?
I see two posibilities:

 1) ui.copy(share_buffer==True) merely does the same, as my patch.
 2) or, deep-copy the buffer structure to the destination ui.

With 1) we'd run into the problems you anticipate.
With 2) the problem arises when/where to copy back the buffered
content to the buffers of the original ui. 

Sorry for the many questions.

Yours,
Elmar.
-- 
LEO GmbH  | Elmar Bartel | 
Mühlweg 2b| Phone: +49 (0)8104-90950141  | No signature here.
D-82054 Sauerlach | Fax:   +49 (0)8104-90950290  |
Germany   | Email: el...@leo.org |

Register Gericht: Amtsgericht München, HRB161107
Geschäftsführer:  Hans Riethmayer, Elmar Bartel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: [PATCH] hg: copy buffer state to remote ui

2020-06-11 Thread Yuya Nishihara
On Thu, 11 Jun 2020 00:14:47 +0200, Elmar Bartel wrote:
> # HG changeset patch
> # User Elmar Bartel 
> # Date 1591826940 -7200
> #  Thu Jun 11 00:09:00 2020 +0200
> # Node ID 563268fce8e7502e17812fea7b90325a37c854f4
> # Parent  83e41b73d115e3717943c2e5a83d36d05670384c
> hg: copy buffer state to remote ui
> 
> When remoteui() creates a new ui, the buffer state of the
> source ui should also be copied to the newly created ui.
> Otherwise, when pushbuffer() was called on the source ui,
> this "push" gets lost for the remote ui and output from the
> remote side will go to default stdout but not to the pushed
> buffer as is expected by the caller of pushbuffer().
> 
> diff -r 83e41b73d115 -r 563268fce8e7 mercurial/hg.py
> --- a/mercurial/hg.py Tue Jun 09 17:13:26 2020 -0400
> +++ b/mercurial/hg.py Thu Jun 11 00:09:00 2020 +0200
> @@ -1362,6 +1362,12 @@ def remoteui(src, opts):
>  if v:
>  dst.setconfig(b'web', b'cacerts', util.expandpath(v), b'copied')
>  
> +# copy buffer state to the remote ui
> +if src._buffers:
> +dst._buffers = src._buffers
> +dst._bufferstates = src._bufferstates
> +dst._bufferapplylabels = src._bufferstates[-1][2]

The state would become inconsistent if you do popbuffer() later on. I don't
know why ui.copy() doesn't preserve the buffer states, but maybe that's why.

And this touches the internal of the ui, we'll need some tests so the change
wouldn't regress. It might be even better to add a function to copy ui with
buffer e.g. ui.copy_sharing_buffer() or ui.copy(share_buffer=True).
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel