Skip to content

Commit

Permalink
scripts: add --hgrc to find-hg-repos.py to find repos with an .hg/hgr…
Browse files Browse the repository at this point in the history
…c file
  • Loading branch information
indygreg committed Nov 5, 2018
1 parent 60b5563 commit 4c7e536
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/find-hg-repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def find_hg_repos(path):
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--group', help='Group owner to search for')
parser.add_argument('--hgrc', action='store_true',
help='Find repositories having an hgrc file')
parser.add_argument('--requirement',
help='Repository requirement to search for')
parser.add_argument('--no-requirement',
Expand Down Expand Up @@ -53,6 +55,10 @@ def fltr(path):
if st.st_gid != gid:
return False

if args.hgrc:
if not os.path.exists(os.path.join(path, '.hg', 'hgrc')):
return False

if args.requirement or args.no_requirement:
try:
with open(os.path.join(path, '.hg', 'requires'), 'rb') as fh:
Expand Down

0 comments on commit 4c7e536

Please sign in to comment.