-x and --exclude options now clear the filtering rules when first found.
This behavior is preferred in order for us to be able to override any exclude filter set via git-config.
This commit is contained in:
parent
3a34be0d06
commit
adf6ee412f
|
@ -34,6 +34,10 @@ def get():
|
||||||
def add(string):
|
def add(string):
|
||||||
__filters__.append(string)
|
__filters__.append(string)
|
||||||
|
|
||||||
|
def clear():
|
||||||
|
global __filters__
|
||||||
|
__filters__ = []
|
||||||
|
|
||||||
def get_filered():
|
def get_filered():
|
||||||
return __filtered_files__
|
return __filtered_files__
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,7 @@ def main():
|
||||||
|
|
||||||
#We need the repo above to be set before we read the git config.
|
#We need the repo above to be set before we read the git config.
|
||||||
config.init(__run__)
|
config.init(__run__)
|
||||||
|
clear_x_on_next_pass = True
|
||||||
|
|
||||||
for o, a in __opts__:
|
for o, a in __opts__:
|
||||||
if o in("-c"):
|
if o in("-c"):
|
||||||
|
@ -178,6 +179,9 @@ def main():
|
||||||
elif o in("--weeks"):
|
elif o in("--weeks"):
|
||||||
__run__.useweeks = optval.get_boolean_argument(a)
|
__run__.useweeks = optval.get_boolean_argument(a)
|
||||||
elif o in("-x", "--exclude"):
|
elif o in("-x", "--exclude"):
|
||||||
|
if clear_x_on_next_pass:
|
||||||
|
clear_x_on_next_pass = False
|
||||||
|
filtering.clear()
|
||||||
filtering.add(a)
|
filtering.add(a)
|
||||||
|
|
||||||
except (format.InvalidFormatError, optval.InvalidOptionArgument, getopt.error) as exception:
|
except (format.InvalidFormatError, optval.InvalidOptionArgument, getopt.error) as exception:
|
||||||
|
|
Loading…
Reference in New Issue