mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
d9f299ffe8
Summary: Now that we moved infinitepush to hgext in D6691670, we can also move the tests. Test Plan: Ran all the tests. Reviewers: stash, #mercurial, #sourcecontrol Reviewed By: stash Differential Revision: https://phabricator.intern.facebook.com/D6691848 Signature: 6691848:1515573470:628d092f14cf3ae21c036883243c80eb3b01aa72
20 lines
476 B
Python
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
|