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
--- 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: