##// END OF EJS Templates
clone: extract helper for checking mutually exclusive args...
clone: extract helper for checking mutually exclusive args We have some duplicated code for aborting if the user provided mutually exclusive arguments. Extensions surely have more such code. We also have duplicated translations and inconsistent output in this area. This patch introduces a simpler helper for checking if more than one option among a given set was given on the command line. I've made the clone code call the function to show that it works. The function has no good way of checking arguments with hyphens in them. I'll add that later if necessary. The function still won't be applicable in all cases, but I think it's still better than nothing. Differential Revision: https://phab.mercurial-scm.org/D7633

File last commit:

r43346:2372284d default
r44344:d5879376 default
Show More
shallowstore.py
18 lines | 491 B | text/x-python | PythonLexer
# shallowstore.py - shallow store for interacting with shallow repos
#
# Copyright 2013 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
def wrapstore(store):
class shallowstore(store.__class__):
def __contains__(self, path):
# Assume it exists
return True
store.__class__ = shallowstore
return store