tests/crashgetbundler.py
author Martin von Zweigbergk <martinvonz@google.com>
Tue, 18 Jan 2022 12:57:55 -0800
changeset 48756 86e4b86df932
parent 43076 2372284d9457
child 48875 6000f5b25c9b
permissions -rw-r--r--
filemerge: when not keeping premerge, don't write markers to context When premerge is enabled (as it is for non-binary inputs by default) and the markers are not kept, we currently still write it to the output context and then restore the previous content right after. With the refactoring in the previous patch, we can easily avoid that step and instead write the output in the opposite case (i.e. when it's successful or when the markers are supposed to be kept). Differential Revision: https://phab.mercurial-scm.org/D12149
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30914
f3807a135e43 wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
from __future__ import absolute_import
f3807a135e43 wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
f3807a135e43 wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
from mercurial.i18n import _
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 30914
diff changeset
     4
from mercurial import changegroup, error, extensions
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 30914
diff changeset
     5
30914
f3807a135e43 wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     6
f3807a135e43 wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     7
def abort(orig, *args, **kwargs):
f3807a135e43 wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     8
    raise error.Abort(_('this is an exercise'))
f3807a135e43 wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     9
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 30914
diff changeset
    10
30914
f3807a135e43 wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    11
def uisetup(ui):
f3807a135e43 wireproto: properly report server Abort during 'getbundle'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    12
    extensions.wrapfunction(changegroup, 'getbundler', abort)