@@ -1255,7 +1255,6 @@ int_info -- a struct sequence with information about the int implementation.\n\
12551255maxsize -- the largest supported length of containers.\n\
12561256maxunicode -- the largest supported character\n\
12571257builtin_module_names -- tuple of module names built into this interpreter\n\
1258- subversion -- subversion information of the build as tuple\n\
12591258version -- the version of this interpreter as a string\n\
12601259version_info -- version information as a named tuple\n\
12611260hexversion -- 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
13961306PyDoc_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 ()));
0 commit comments