opportunistically update lastsync.txt
diff --git a/backport.py b/backport.py
index 147e3e6..7719dc4 100644
--- a/backport.py
+++ b/backport.py
@@ -1,6 +1,6 @@
import re
from argparse import ArgumentParser
-from os.path import dirname, abspath
+from os.path import dirname, abspath, join
from subprocess import check_output, call
@@ -74,6 +74,11 @@
call(f'git am -k --reject {patch_path}', cwd=mock_repo, shell=True)
+def update_last_sync(mock_repo, rev):
+ with open(join(mock_repo, 'lastsync.txt'), 'w') as target:
+ target.write(rev+'\n')
+ print(f'update lastsync.txt to {rev}')
+
def main():
args = parse_args()
@@ -88,6 +93,7 @@
for rev in revs:
if has_been_backported(args.mock, rev):
+ update_last_sync(args.mock, rev)
continue
patch = extract_patch_for(args.cpython, rev)
diff --git a/docs/index.txt b/docs/index.txt
index dc6d940..a7bc3a4 100644
--- a/docs/index.txt
+++ b/docs/index.txt
@@ -186,3 +186,6 @@
above.
5. Rinse and repeat until ``backport.py`` reports no more patches need applying.
+
+6. If ``backport.py`` has updated ``lastsync.txt``, now would be a good time
+ to commit that change.
diff --git a/lastsync.txt b/lastsync.txt
index 1e9cca5..df3029e 100644
--- a/lastsync.txt
+++ b/lastsync.txt
@@ -1 +1 @@
-e437a10d15ddfd21d406e591acccf12ff443194e
+5943ea76d529f9ea18c73a61e10c6f53bdcc864f