Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1184)

Unified Diff: build/util/lastchange.py

Issue 2826263003: lastchange: Remove more unused SVN code. (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/util/lastchange.py
diff --git a/build/util/lastchange.py b/build/util/lastchange.py
index 3324f31466b7538946c49d498c79af8c2f5cae50..0e3102f4b82482907d2044e1c25e735615a645ae 100755
--- a/build/util/lastchange.py
+++ b/build/util/lastchange.py
@@ -13,11 +13,8 @@ import os
import subprocess
import sys
-_GIT_SVN_ID_REGEX = re.compile(r'.*git-svn-id:\s*([^@]*)@([0-9]+)', re.DOTALL)
-
class VersionInfo(object):
- def __init__(self, url, revision):
- self.url = url
+ def __init__(self, revision):
self.revision = revision
@@ -75,21 +72,17 @@ def FetchGitRevision(directory):
if line.startswith('Cr-Commit-Position:'):
pos = line.rsplit()[-1].strip()
break
- return VersionInfo('git', '%s-%s' % (hsh, pos))
+ return VersionInfo('%s-%s' % (hsh, pos))
-def FetchVersionInfo(directory=None,
- directory_regex_prior_to_src_url='chrome|svn'):
+def FetchVersionInfo(directory=None):
"""
Returns the last change (in the form of a branch, revision tuple),
from some appropriate revision control system.
"""
- svn_url_regex = re.compile(
- r'.*/(' + directory_regex_prior_to_src_url + r')(/.*)')
-
version_info = FetchGitRevision(directory)
if not version_info:
- version_info = VersionInfo(None, None)
+ version_info = VersionInfo(None)
return version_info
@@ -112,8 +105,7 @@ def GetHeaderGuard(path):
def GetHeaderContents(path, define, version):
"""
Returns what the contents of the header file should be that indicate the given
- revision. Note that the #define is specified as a string, even though it's
- currently always a SVN revision number, in case we need to move to git hashes.
+ revision.
"""
header_guard = GetHeaderGuard(path)
@@ -164,7 +156,7 @@ def main(argv=None):
help="Write last change to FILE as a C/C++ header. " +
"Can be combined with --output to write both files.")
parser.add_option("--revision-only", action='store_true',
- help="Just print the SVN revision number. Overrides any " +
+ help="Just print the GIT hash. Overrides any " +
"file-output-related options.")
parser.add_option("-s", "--source-dir", metavar="DIR",
help="Use repository in the given directory.")
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698