return utcs
utcs = sorted(utcs, reverse=True)
period_start = dict(spec)
- for kind, duration in compat.items(period_start):
+ for kind, duration in period_start.items():
period_start[kind] = utc_start - period_as_secs(duration)
period_start = defaultdict(lambda: float('inf'), period_start)
three_years_ago = now - (60 * 60 * 24 * 366 * 3)
chdir(tmpdir)
ex([b'git', b'init', b'work'])
+ ex([b'git', b'symbolic-ref', b'HEAD', b'refs/heads/main'])
ex([b'git', b'config', b'gc.autoDetach', b'false'])
wvstart('generating ' + str(save_population) + ' random saves')
chdir(tmpdir + b'/work')
save_utcs = create_older_random_saves(save_population, three_years_ago, now)
chdir(tmpdir)
- test_set_hash = exo([b'git', b'show-ref', b'-s', b'master']).out.rstrip()
- ls_saves = exo((bup_cmd, b'ls', b'master')).out.splitlines()
+ test_set_hash = exo([b'git', b'show-ref', b'-s', b'main']).out.rstrip()
+ ls_saves = exo((bup_cmd, b'ls', b'main')).out.splitlines()
wvpasseq(save_population + 1, len(ls_saves))
wvstart('ensure everything kept, if no keep arguments')
proc = ex((bup_cmd,
b'prune-older', b'-v', b'--unsafe', b'--no-gc',
b'--wrt', b'%d' % now) \
- + (b'master',),
+ + (b'main',),
stdout=None, stderr=PIPE, check=False)
wvpassne(proc.rc, 0)
wvpass(b'at least one keep argument is required' in proc.err)
b'prune-older', b'-v', b'--unsafe', b'--no-gc', b'--wrt',
b'%d' % now) \
+ period_spec_to_period_args(spec) \
- + (b'master',))
+ + (b'main',))
check_prune_result(expected)
ex((bup_cmd,
b'prune-older', b'-v', b'--unsafe', b'--wrt', b'%d' % now) \
+ period_spec_to_period_args(spec) \
- + (b'master',))
+ + (b'main',))
check_prune_result(expected)