Author: danielsh
Date: Fri Aug  2 17:27:25 2019
New Revision: 1864246

URL: http://svn.apache.org/viewvc?rev=1864246&view=rev
Log:
* site/tools/upcoming.py
  (get_reference_version__from_working_copy): New function, split from..
  (copyfrom_revision_of_previous_tag_of_this_stable_branch): .. here.
  (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=1864246&r1=1864245&r2=1864246&view=diff
==============================================================================
--- subversion/site/tools/upcoming.py (original)
+++ subversion/site/tools/upcoming.py Fri Aug  2 17:27:25 2019
@@ -34,9 +34,8 @@ def versions_on_dist_release():
     versions = (Version(**each_dict) for each_dict in versions)
     return tuple(versions)
 
-def copyfrom_revision_of_previous_tag_of_this_stable_branch():
-    """Returns the copyfrom revision of the previous tag of the stable branch
-    checked out in cwd."""
+def get_reference_version__from_working_copy():
+    "Get the reference version from the stable branch checked out in cwd."
     ### Doesn't work during the alpha/beta/rc phase; works only after 1.A.0 
has been tagged
     version_string = subprocess.check_output(['build/getversion.py', 'SVN', 
'subversion/include/svn_version.h']).decode()
     version_broken_down = Version(*map(int, version_string.split('.')))
@@ -47,6 +46,12 @@ def copyfrom_revision_of_previous_tag_of
     # - older than the working copy.
     reference_version = max(v for v in versions_on_dist_release()
                             if v[:2] == version_broken_down[:2] and v < 
version_broken_down)
+    return reference_version
+
+def copyfrom_revision_of_previous_tag_of_this_stable_branch(reference_version):
+    """Returns the copyfrom revision of the REFERENCE_VERSION tag."""
+    assert isinstance(reference_version, Version)
+
     target = '^/subversion/tags/' + '.'.join(map(str, reference_version))
     log_output = \
         subprocess.check_output(
@@ -81,7 +86,8 @@ def get_merges_for_range(start, end, tar
 def main():
     print("Changes in " + relative_url() + ":")
 
-    start_revision = copyfrom_revision_of_previous_tag_of_this_stable_branch() 
+ 1
+    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"):
         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."""


Reply via email to