Author: danielsh
Date: Fri Aug  2 17:38:31 2019
New Revision: 1864253

URL: http://svn.apache.org/viewvc?rev=1864253&view=rev
Log:
site: upcoming.py: Continue removing uses of the cwd.

No functional change.

* site/tools/upcoming.py
  (relative_url): Remove.
  (get_merges_for_range): Change signature.
    Stop calling relative_url(), which, incidentally, removes a fork() from
    each iteration of the loop.
  (main): Instead of calling relative_url(), just compute the URL directly.

Modified:
    subversion/site/tools/upcoming.py

Modified: subversion/site/tools/upcoming.py
URL: 
http://svn.apache.org/viewvc/subversion/site/tools/upcoming.py?rev=1864253&r1=1864252&r2=1864253&view=diff
==============================================================================
--- subversion/site/tools/upcoming.py (original)
+++ subversion/site/tools/upcoming.py Fri Aug  2 17:38:31 2019
@@ -59,16 +59,9 @@ def copyfrom_revision_of_previous_tag_of
         ).decode()
     return int(re.compile(r'[(]from \S*:(\d+)[)]').search(log_output).group(1))
 
-def relative_url(target="."):
-    """Return the repository-relative URL (with '^/' prefix) of TARGET,
-       which is expected to be the root of a branch.
-    """
-    return subprocess.check_output([SVN, 'info', '--show-item', 'relative-url',
-                                    '--', target + '@']).decode().rstrip('\n')
-
-def get_merges_for_range(start, end, target="."):
+def get_merges_for_range(start, end, target):
     """Return an array of revision numbers in the range -r START:END that are
-    merges."""
+    merges. TARGET is passed to 'svn log'."""
 
     cache = []
     revisions = \
@@ -79,16 +72,16 @@ def get_merges_for_range(start, end, tar
     log_xml = ET.fromstring(revisions)
 
     for logentry in log_xml.findall('./logentry'):
-        is_merge = relative_url()[1:] in (path.text for path in 
logentry.findall('.//path'))
+        is_merge = target[1:] in (path.text for path in 
logentry.findall('.//path'))
         if is_merge:
             yield logentry
 
 def main():
-    print("Changes in " + relative_url() + ":")
-
     reference_version = get_reference_version__from_working_copy()
     start_revision = 
copyfrom_revision_of_previous_tag_of_this_stable_branch(reference_version) + 1
-    for logentry in get_merges_for_range(start_revision, "HEAD"):
+    target = 
'^/subversion/branches/{major}.{minor}.x'.format(**reference_version._asdict())
+    print("Changes in " + target + ":")
+    for logentry in get_merges_for_range(start_revision, "HEAD", target):
         f = lambda s: logentry.findall('./' + s)[0].text
         f.__doc__ = """Get the contents of the first child tag whose name is 
given as an argument."""
         print(LOG_SEPARATOR_LINE, end='')


Reply via email to