From bae65885a353e49fbb54a3310b6b5334d20e42ad Mon Sep 17 00:00:00 2001
From: Martin Fischer <martin@push-f.com>
Date: Sat, 25 Jun 2022 01:10:09 +0200
Subject: move osm_base to edit summary

to avoid creating revisions if the data didn't change
---
 fetch_data.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fetch_data.py b/fetch_data.py
index a0753c4..aa3fa25 100755
--- a/fetch_data.py
+++ b/fetch_data.py
@@ -172,7 +172,6 @@ text = f'''\
 -- This page is automatically generated by a Python script using the Overpass API.
 -- {overpass_info['copyright']}
 -- The wikidata_length data is queried from www.wikidata.org and available under Creative Commons CC0 License.
--- osm_base = {overpass_info['timestamp_osm_base']}
 
 return ''' + luadata.serialize(
     dict(relations=relations)
@@ -183,6 +182,12 @@ if args.update:
         creds = tomli.load(f)
     osmwiki.login(creds['username'], creds['password'])
     csrf_token = osmwiki('query', meta='tokens')['query']['tokens']['csrftoken']
-    osmwiki('edit', title='Module:Report/data', text=text, token=csrf_token)
+    osmwiki(
+        'edit',
+        title='Module:Report/data',
+        text=text,
+        token=csrf_token,
+        summary=f"update (osm_base = {overpass_info['timestamp_osm_base']})",
+    )
 else:
     print(text)
-- 
cgit v1.2.3