generate-hg-s3-bundles: simplify generaldelta checking (bug 1354311); r?glob draft
authorGregory Szorc <gps@mozilla.com>
Thu, 06 Apr 2017 14:57:36 -0700
changeset 10724 ee0977685431d265330a7babe81eb87d0fae11e6
parent 10723 d2c006a3ee7659c2960124bb7a8cf7e4596d2b94
child 10725 65a542b7aac87ad75d70b130edf4856fdf1d8041
push id1613
push userbmo:gps@mozilla.com
push dateFri, 07 Apr 2017 00:08:28 +0000
reviewersglob
bugs1354311
generate-hg-s3-bundles: simplify generaldelta checking (bug 1354311); r?glob This is never a large file. We can use a one-liner. MozReview-Commit-ID: IphD1x6IMtM
scripts/generate-hg-s3-bundles
--- a/scripts/generate-hg-s3-bundles
+++ b/scripts/generate-hg-s3-bundles
@@ -226,21 +226,18 @@ def generate_bundles(repo, upload=True, 
     gid = hg_stat.st_gid
 
     # Bundle files are named after the tip revision in the repository at
     # the time the bundle was created. This is the easiest way to name
     # bundle files.
     tip = subprocess.check_output([HG, '-R', repo_full, 'log', '-r', 'tip', '-T', '{node}'])
     print('tip is %s' % tip)
 
-    generaldelta = False
     with open(os.path.join(repo_full, '.hg', 'requires'), 'rb') as fh:
-        for line in fh:
-            if line.strip() == 'generaldelta':
-                generaldelta = True
+        generaldelta = 'generaldelta\n' in fh.readlines()
 
     bundle_path = os.path.join(BUNDLE_ROOT, repo)
 
     # Create directory to hold bundle files.
     try:
         os.makedirs(bundle_path, 0755)
     except OSError as e:
         if e.errno != errno.EEXIST: