sapling/tests/lockfail.py
Stanislau Hlebik 09d6fda2a0 infinitepush: avoid using push during debugbackup
Summary:
`hg push` takes a lock because it updates phases and may receive other bundle2
parts from remote server. We don't need it in debugbackup. And since
debugbackup is intended to run in background we want to avoid taking locks.
Instead let's use raw `unbundle()` wireproto method and disable pushback
bundle2 parts.

Test Plan: Run `test-infinitepush-*`

Reviewers: durham, rmcelroy, mitrandir, quark

Reviewed By: quark

Subscribers: mjpieters, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D4291740

Tasks: 12479677

Signature: t1:4291740:1481118369:1b20f771c5db6e4fed4fc18681cc66ef4e91dd3a
2016-12-07 06:05:29 -08:00

20 lines
476 B
Python

# Dummy extension that throws if lock is taken
#
# This extension can be used to test that lock is not taken when it's not
# supposed to
from __future__ import absolute_import
from mercurial import error
def reposetup(ui, repo):
class faillockrepo(repo.__class__):
def lock(self, wait=True):
raise error.Abort('lock is taken!')
def wlock(self, wait=True):
raise error.Abort('lock is taken!')
repo.__class__ = faillockrepo