scripts: add option to find repositories with obsolescence store
authorGregory Szorc <gps@mozilla.com>
Wed, 25 Apr 2018 14:09:26 -0700
changeset 5866 090cab714ac5
parent 5865 c121abebd6c4
child 5867 e33dd348117c
push id2726
push usergszorc@mozilla.com
push date2018-04-25 21:09 +0000
treeherderversion-control-tools@090cab714ac5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
scripts: add option to find repositories with obsolescence store
scripts/find-hg-repos.py
--- a/scripts/find-hg-repos.py
+++ b/scripts/find-hg-repos.py
@@ -26,16 +26,19 @@ if __name__ == '__main__':
     parser.add_argument('--group', help='Group owner to search for')
     parser.add_argument('--requirement',
                         help='Repository requirement to search for')
     parser.add_argument('--no-requirement',
                         help='Missing repository requirement to search for')
     parser.add_argument('--upgrade-backup', action='store_true',
                         help='Find repositories that have a backup repo from '
                              'an upgrade')
+    parser.add_argument('--obsstore', action='store_true',
+                        help='Find repositories that have an obsolescence '
+                             'store')
     parser.add_argument('paths', nargs='+')
 
     args = parser.parse_args()
 
     gid = None
     if args.group:
         try:
             group = grp.getgrnam(args.group)
@@ -66,16 +69,21 @@ if __name__ == '__main__':
             if args.no_requirement and args.no_requirement in requirements:
                 return False
 
         if args.upgrade_backup:
             entries = os.listdir(os.path.join(path, '.hg'))
             if not any(e.startswith('upgradebackup.') for e in entries):
                 return False
 
+        if args.obsstore:
+            p = os.path.join(path, '.hg', 'store', 'obsstore')
+            if not os.path.exists(p):
+                return False
+
         return True
 
     for d in args.paths:
         for path in find_hg_repos(d):
             if not fltr(path):
                 continue
 
             print(path[len(d):])