Cédric Krier pushed to branch branch/default at Tryton / Tools


Commits:
f3bbf8ad by Cédric Krier at 2023-01-03T00:23:40+01:00
Replace follow revision specification for file path
- - - - -


1 changed file:

- to_release


Changes:

=====================================
to_release
=====================================
@@ -12,6 +12,10 @@
         'hg branches -r "not topic()" -T "{branch}\\n"',
         shell=True, universal_newlines=True).splitlines()
     branches.remove('default')
+    filenames = chain(
+        glob.glob('*/setup.py'),
+        glob.glob('modules/*/setup.py'),
+        glob.glob('*/package.json'))
 else:
     branches = subprocess.check_output(
         'hg branch', shell=True, universal_newlines=True).splitlines()
@@ -15,4 +19,7 @@
 else:
     branches = subprocess.check_output(
         'hg branch', shell=True, universal_newlines=True).splitlines()
+    filenames = chain(
+        glob.glob('setup.py'),
+        glob.glob('package.json'))
 
@@ -18,10 +25,11 @@
 
-for filename in chain(
-        glob.glob('**/setup.py', recursive=True),
-        glob.glob('**/package.json', recursive=True)):
-    dirname = os.path.relpath(
-        os.path.join(os.getcwd(), os.path.dirname(filename)), root_dir)
+for filename in filenames:
+    dirpath = os.path.join(os.getcwd(), os.path.dirname(filename))
+    dirname = os.path.relpath(dirpath, root_dir)
+    dirpath = os.path.relpath(dirpath, os.getcwd())
+
+    package = os.path.basename(dirname)
 
     for branch in branches:
         changesets = subprocess.check_output(
             'hg log '
@@ -24,8 +32,7 @@
 
     for branch in branches:
         changesets = subprocess.check_output(
             'hg log '
-            f'-r "only(\'{branch}\', tagged() and ancestors(\'{branch}\')) '
-            f'and follow(\'{dirname}\', \'{branch}\') '
+            f'-r "only(\'{branch}\', tag(r\'re:{package}-.*\')) '
             'and not grep(r\'^Increase version number$\') '
             'and not grep(r\'^Prepare migration to monorepo$\')" '
@@ -30,6 +37,6 @@
             'and not grep(r\'^Increase version number$\') '
             'and not grep(r\'^Prepare migration to monorepo$\')" '
-            f'-T "{{node}}\\n"',
+            f'-T "{{node}}\\n" "{dirpath}"',
             shell=True, universal_newlines=True)
         changes = len(changesets.splitlines())
         if changes:



View it on Heptapod: 
https://foss.heptapod.net/tryton/tools/-/commit/f3bbf8ad2bf9c55c020f7cb18a57174de53ae615

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tools/-/commit/f3bbf8ad2bf9c55c020f7cb18a57174de53ae615
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to