changeset 6545:7b2bd0332b56

topic: transaction names sometimes need stripping of URLs Transaction names during push or pull usually contain URL of the remote repo. Specifying e.g. tns-report-transactions=pull,push wouldn't work as expected unless we strip URLs from transaction names, so now we do it for this check.
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 13 Aug 2023 16:08:26 -0300
parents 44bc900ba5db
children d13cfd9eb6c0
files hgext3rd/topic/__init__.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Thu Aug 03 16:32:41 2023 -0300
+++ b/hgext3rd/topic/__init__.py	Sun Aug 13 16:08:26 2023 -0300
@@ -494,9 +494,11 @@
 
 def report_affected_tns(repo, tr):
     report = set(repo.ui.configlist(b'devel', b'tns-report-transactions'))
+    # transaction names sometimes also have a URL after a newline byte
+    trnames = (trname.partition(b'\n')[0] for trname in tr._names)
     if b'*' not in report:
         # * matches any transaction
-        if not any(trname in report for trname in tr._names):
+        if not any(trname in report for trname in trnames):
             return
 
     if tr.changes[b'tns']: