Author: danielsh
Date: Fri Aug  2 18:10:59 2019
New Revision: 1864264

URL: http://svn.apache.org/viewvc?rev=1864264&view=rev
Log:
site: tools/upcoming.py: Remove the last remnant of working copy usage: use of
the short URL syntax.

For SVN-4823.

* site/tools/upcoming.py:
  (REPOS_ROOT_URL): New.
  (copyfrom_revision_of_previous_tag_of_this_stable_branch):
    Don't use the short URL syntax.
  (get_merges_for_range): Change argument type.
  (main): Update caller.

Modified:
    subversion/site/tools/upcoming.py

Modified: subversion/site/tools/upcoming.py
URL: 
http://svn.apache.org/viewvc/subversion/site/tools/upcoming.py?rev=1864264&r1=1864263&r2=1864264&view=diff
==============================================================================
--- subversion/site/tools/upcoming.py (original)
+++ subversion/site/tools/upcoming.py Fri Aug  2 18:10:59 2019
@@ -22,6 +22,7 @@ import xml.etree.ElementTree as ET
 SVN = os.getenv('SVN', 'svn')
 LOG_SEPARATOR_LINE = ('-' * 72) + '\n'
 DIST_RELEASE_URL = 'https://dist.apache.org/repos/dist/release/subversion'
+REPOS_ROOT_URL = 'https://svn.apache.org/repos/asf'
 
 Version = collections.namedtuple('Version', 'major minor patch')
 
@@ -77,36 +78,36 @@ def copyfrom_revision_of_previous_tag_of
     """Returns the copyfrom revision of the REFERENCE_VERSION tag."""
     assert isinstance(reference_version, Version)
 
-    target = '^/subversion/tags/' + '.'.join(map(str, reference_version))
+    target = REPOS_ROOT_URL + '/subversion/tags/' + '.'.join(map(str, 
reference_version))
     log_output = \
         subprocess.check_output(
             [SVN, 'log', '-q', '-v', '-l1', '-rHEAD:0', '--stop-on-copy', 
'--', target + '@']
         ).decode()
     return int(re.compile(r'[(]from \S*:(\d+)[)]').search(log_output).group(1))
 
-def get_merges_for_range(start, end, target):
+def get_merges_for_range(start, end, target_fspath):
     """Return an array of revision numbers in the range -r START:END that are
-    merges. TARGET is passed to 'svn log'."""
+    merges. TARGET_FSPATH is passed to 'svn log'."""
 
     cache = []
     revisions = \
         subprocess.check_output(
             [SVN, 'log', '--xml', '-v', '-r', str(start) + ":" + str(end),
-             '--', target + "@" + str(end)],
+             '--', REPOS_ROOT_URL + target_fspath + "@" + str(end)],
         ).decode()
     log_xml = ET.fromstring(revisions)
 
     for logentry in log_xml.findall('./logentry'):
-        is_merge = target[1:] in (path.text for path in 
logentry.findall('.//path'))
+        is_merge = target_fspath in (path.text for path in 
logentry.findall('.//path'))
         if is_merge:
             yield logentry
 
 def main():
     reference_version = get_reference_version()
     start_revision = 
copyfrom_revision_of_previous_tag_of_this_stable_branch(reference_version) + 1
-    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):
+    target_fspath = 
'/subversion/branches/{major}.{minor}.x'.format(**reference_version._asdict())
+    print("Changes in " + '^'+target_fspath + ":")
+    for logentry in get_merges_for_range(start_revision, "HEAD", 
target_fspath):
         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