Skip to content

Commit 776e586

Browse files
committed
Remove sys.subversion and svn build identification leftovers.
1 parent fe09a54 commit 776e586

8 files changed

Lines changed: 1 addition & 191 deletions

File tree

Doc/library/sys.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,6 @@ always available.
3636
little-endian (least-significant byte first) platforms.
3737

3838

39-
.. data:: subversion
40-
41-
A triple (repo, branch, version) representing the Subversion information of the
42-
Python interpreter. *repo* is the name of the repository, ``'CPython'``.
43-
*branch* is a string of one of the forms ``'trunk'``, ``'branches/name'`` or
44-
``'tags/name'``. *version* is the output of ``svnversion``, if the interpreter
45-
was built from a Subversion checkout; it contains the revision number (range)
46-
and possibly a trailing 'M' if there were local modifications. If the tree was
47-
exported (or svnversion was not available), it is the revision of
48-
``Include/patchlevel.h`` if the branch is a tag. Otherwise, it is ``None``.
49-
50-
5139
.. data:: builtin_module_names
5240

5341
A tuple of strings giving the names of all modules that are compiled into this

Include/pythonrun.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ PyAPI_FUNC(const char *) Py_GetCopyright(void);
179179
PyAPI_FUNC(const char *) Py_GetCompiler(void);
180180
PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
181181
#ifndef Py_LIMITED_API
182-
PyAPI_FUNC(const char *) _Py_svnversion(void);
183-
PyAPI_FUNC(const char *) Py_SubversionRevision(void);
184-
PyAPI_FUNC(const char *) Py_SubversionShortBranch(void);
185182
PyAPI_FUNC(const char *) _Py_hgidentifier(void);
186183
PyAPI_FUNC(const char *) _Py_hgversion(void);
187184
#endif

Lib/test/test_platform.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,11 @@ def test_processor(self):
5656

5757
def setUp(self):
5858
self.save_version = sys.version
59-
self.save_subversion = sys.subversion
6059
self.save_mercurial = sys._mercurial
6160
self.save_platform = sys.platform
6261

6362
def tearDown(self):
6463
sys.version = self.save_version
65-
sys.subversion = self.save_subversion
6664
sys._mercurial = self.save_mercurial
6765
sys.platform = self.save_platform
6866

@@ -77,7 +75,7 @@ def test_sys_version(self):
7775
('IronPython', '1.0.0', '', '', '', '', '.NET 2.0.50727.42')),
7876
):
7977
# branch and revision are not "parsed", but fetched
80-
# from sys.subversion. Ignore them
78+
# from sys._mercurial. Ignore them
8179
(name, version, branch, revision, buildno, builddate, compiler) \
8280
= platform._sys_version(input)
8381
self.assertEqual(
@@ -113,8 +111,6 @@ def test_sys_version(self):
113111
if subversion is None:
114112
if hasattr(sys, "_mercurial"):
115113
del sys._mercurial
116-
if hasattr(sys, "subversion"):
117-
del sys.subversion
118114
else:
119115
sys._mercurial = subversion
120116
if sys_platform is not None:

Makefile.pre.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ MAINCC= @MAINCC@
3434
LINKCC= @LINKCC@
3535
AR= @AR@
3636
RANLIB= @RANLIB@
37-
SVNVERSION= @SVNVERSION@
3837
SOABI= @SOABI@
3938
LDVERSION= @LDVERSION@
4039
HGVERSION= @HGVERSION@
@@ -556,7 +555,6 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
556555
$(MODOBJS) \
557556
$(srcdir)/Modules/getbuildinfo.c
558557
$(CC) -c $(PY_CORE_CFLAGS) \
559-
-DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" \
560558
-DHGVERSION="\"`LC_ALL=C $(HGVERSION)`\"" \
561559
-DHGTAG="\"`LC_ALL=C $(HGTAG)`\"" \
562560
-DHGBRANCH="\"`LC_ALL=C $(HGBRANCH)`\"" \
@@ -1281,7 +1279,6 @@ smelly: all
12811279
# Find files with funny names
12821280
funny:
12831281
find $(DISTDIRS) \
1284-
-name .svn -prune \
12851282
-o -type d \
12861283
-o -name '*.[chs]' \
12871284
-o -name '*.py' \

Modules/getbuildinfo.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@
2020
#endif
2121
#endif
2222

23-
/* on unix, SVNVERSION is passed on the command line.
24-
* on Windows, the string is interpolated using
25-
* subwcrev.exe
26-
*/
27-
#ifndef SVNVERSION
28-
#define SVNVERSION "$WCRANGE$$WCMODS?M:$"
29-
#endif
30-
3123
/* XXX Only unix build process has been tested */
3224
#ifndef HGVERSION
3325
#define HGVERSION ""
@@ -54,16 +46,6 @@ Py_GetBuildInfo(void)
5446
return buildinfo;
5547
}
5648

57-
const char *
58-
_Py_svnversion(void)
59-
{
60-
/* the following string can be modified by subwcrev.exe */
61-
static const char svnversion[] = SVNVERSION;
62-
if (svnversion[0] != '$')
63-
return svnversion; /* it was interpolated, or passed on command line */
64-
return "Unversioned directory";
65-
}
66-
6749
const char *
6850
_Py_hgversion(void)
6951
{

Python/sysmodule.c

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,6 @@ int_info -- a struct sequence with information about the int implementation.\n\
12551255
maxsize -- the largest supported length of containers.\n\
12561256
maxunicode -- the largest supported character\n\
12571257
builtin_module_names -- tuple of module names built into this interpreter\n\
1258-
subversion -- subversion information of the build as tuple\n\
12591258
version -- the version of this interpreter as a string\n\
12601259
version_info -- version information as a named tuple\n\
12611260
hexversion -- version information encoded as a single integer\n\
@@ -1303,95 +1302,6 @@ settrace() -- set the global debug tracing function\n\
13031302
)
13041303
/* end of sys_doc */ ;
13051304

1306-
/* Subversion branch and revision management */
1307-
static const char _patchlevel_revision[] = PY_PATCHLEVEL_REVISION;
1308-
static const char headurl[] = "$HeadURL$";
1309-
static int svn_initialized;
1310-
static char patchlevel_revision[50]; /* Just the number */
1311-
static char branch[50];
1312-
static char shortbranch[50];
1313-
static const char *svn_revision;
1314-
1315-
static void
1316-
svnversion_init(void)
1317-
{
1318-
const char *python, *br_start, *br_end, *br_end2, *svnversion;
1319-
Py_ssize_t len;
1320-
int istag = 0;
1321-
1322-
if (svn_initialized)
1323-
return;
1324-
1325-
python = strstr(headurl, "/python/");
1326-
if (!python) {
1327-
strcpy(branch, "unknown branch");
1328-
strcpy(shortbranch, "unknown");
1329-
}
1330-
else {
1331-
br_start = python + 8;
1332-
br_end = strchr(br_start, '/');
1333-
assert(br_end);
1334-
1335-
/* Works even for trunk,
1336-
as we are in trunk/Python/sysmodule.c */
1337-
br_end2 = strchr(br_end+1, '/');
1338-
1339-
istag = strncmp(br_start, "tags", 4) == 0;
1340-
if (strncmp(br_start, "trunk", 5) == 0) {
1341-
strcpy(branch, "trunk");
1342-
strcpy(shortbranch, "trunk");
1343-
}
1344-
else if (istag || strncmp(br_start, "branches", 8) == 0) {
1345-
len = br_end2 - br_start;
1346-
strncpy(branch, br_start, len);
1347-
branch[len] = '\0';
1348-
1349-
len = br_end2 - (br_end + 1);
1350-
strncpy(shortbranch, br_end + 1, len);
1351-
shortbranch[len] = '\0';
1352-
}
1353-
else {
1354-
Py_FatalError("bad HeadURL");
1355-
return;
1356-
}
1357-
}
1358-
1359-
1360-
svnversion = _Py_svnversion();
1361-
if (strcmp(svnversion, "Unversioned directory") != 0 && strcmp(svnversion, "exported") != 0)
1362-
svn_revision = svnversion;
1363-
else if (istag) {
1364-
len = strlen(_patchlevel_revision);
1365-
assert(len >= 13);
1366-
assert(len < (sizeof(patchlevel_revision) + 13));
1367-
strncpy(patchlevel_revision, _patchlevel_revision + 11,
1368-
len - 13);
1369-
patchlevel_revision[len - 13] = '\0';
1370-
svn_revision = patchlevel_revision;
1371-
}
1372-
else
1373-
svn_revision = "";
1374-
1375-
svn_initialized = 1;
1376-
}
1377-
1378-
/* Return svnversion output if available.
1379-
Else return Revision of patchlevel.h if on branch.
1380-
Else return empty string */
1381-
const char*
1382-
Py_SubversionRevision()
1383-
{
1384-
svnversion_init();
1385-
return svn_revision;
1386-
}
1387-
1388-
const char*
1389-
Py_SubversionShortBranch()
1390-
{
1391-
svnversion_init();
1392-
return shortbranch;
1393-
}
1394-
13951305

13961306
PyDoc_STRVAR(flags__doc__,
13971307
"sys.flags\n\
@@ -1595,10 +1505,6 @@ _PySys_Init(void)
15951505
PyUnicode_FromString(Py_GetVersion()));
15961506
SET_SYS_FROM_STRING("hexversion",
15971507
PyLong_FromLong(PY_VERSION_HEX));
1598-
svnversion_init();
1599-
SET_SYS_FROM_STRING("subversion",
1600-
Py_BuildValue("(sss)", "CPython", branch,
1601-
svn_revision));
16021508
SET_SYS_FROM_STRING("_mercurial",
16031509
Py_BuildValue("(szz)", "CPython", _Py_hgidentifier(),
16041510
_Py_hgversion()));

configure

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ HAS_HG
648648
HGBRANCH
649649
HGTAG
650650
HGVERSION
651-
SVNVERSION
652651
ARFLAGS
653652
AR
654653
RANLIB
@@ -5125,52 +5124,6 @@ then
51255124
fi
51265125
51275126
5128-
# Extract the first word of "svnversion", so it can be a program name with args.
5129-
set dummy svnversion; ac_word=$2
5130-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5131-
$as_echo_n "checking for $ac_word... " >&6; }
5132-
if ${ac_cv_prog_SVNVERSION+:} false; then :
5133-
$as_echo_n "(cached) " >&6
5134-
else
5135-
if test -n "$SVNVERSION"; then
5136-
ac_cv_prog_SVNVERSION="$SVNVERSION" # Let the user override the test.
5137-
else
5138-
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5139-
for as_dir in $PATH
5140-
do
5141-
IFS=$as_save_IFS
5142-
test -z "$as_dir" && as_dir=.
5143-
for ac_exec_ext in '' $ac_executable_extensions; do
5144-
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5145-
ac_cv_prog_SVNVERSION="found"
5146-
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5147-
break 2
5148-
fi
5149-
done
5150-
done
5151-
IFS=$as_save_IFS
5152-
5153-
test -z "$ac_cv_prog_SVNVERSION" && ac_cv_prog_SVNVERSION="not-found"
5154-
fi
5155-
fi
5156-
SVNVERSION=$ac_cv_prog_SVNVERSION
5157-
if test -n "$SVNVERSION"; then
5158-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SVNVERSION" >&5
5159-
$as_echo "$SVNVERSION" >&6; }
5160-
else
5161-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5162-
$as_echo "no" >&6; }
5163-
fi
5164-
5165-
5166-
if test $SVNVERSION = found
5167-
then
5168-
SVNVERSION="svnversion \$(srcdir)"
5169-
else
5170-
SVNVERSION="echo Unversioned directory"
5171-
fi
5172-
5173-
51745127
51755128
51765129
# Extract the first word of "hg", so it can be a program name with args.

configure.in

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -801,15 +801,6 @@ then
801801
ARFLAGS="rc"
802802
fi
803803

804-
AC_SUBST(SVNVERSION)
805-
AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
806-
if test $SVNVERSION = found
807-
then
808-
SVNVERSION="svnversion \$(srcdir)"
809-
else
810-
SVNVERSION="echo Unversioned directory"
811-
fi
812-
813804
AC_SUBST(HGVERSION)
814805
AC_SUBST(HGTAG)
815806
AC_SUBST(HGBRANCH)

0 commit comments

Comments
 (0)