Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3ab577

Browse files
committed
merge
2 parents e402724 + 1d4ae84 commit c3ab577

1 file changed

Lines changed: 4 additions & 56 deletions

File tree

Python/sysmodule.c

Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,6 @@ settrace() -- set the global debug tracing function\n\
10651065
/* end of sys_doc */ ;
10661066

10671067
/* Subversion branch and revision management */
1068-
static const char _patchlevel_revision[] = PY_PATCHLEVEL_REVISION;
1069-
static const char headurl[] = "$HeadURL$";
10701068
static int svn_initialized;
10711069
static char patchlevel_revision[50]; /* Just the number */
10721070
static char branch[50];
@@ -1076,64 +1074,14 @@ static const char *svn_revision;
10761074
static void
10771075
svnversion_init(void)
10781076
{
1079-
const char *python, *br_start, *br_end, *br_end2, *svnversion;
1080-
Py_ssize_t len;
1081-
int istag = 0;
1082-
10831077
if (svn_initialized)
10841078
return;
10851079

1086-
python = strstr(headurl, "/python/");
1087-
if (!python) {
1088-
strcpy(branch, "unknown branch");
1089-
strcpy(shortbranch, "unknown");
1090-
}
1091-
else {
1092-
br_start = python + 8;
1093-
br_end = strchr(br_start, '/');
1094-
assert(br_end);
1095-
1096-
/* Works even for trunk,
1097-
as we are in trunk/Python/sysmodule.c */
1098-
br_end2 = strchr(br_end+1, '/');
1099-
1100-
istag = strncmp(br_start, "tags", 4) == 0;
1101-
if (strncmp(br_start, "trunk", 5) == 0) {
1102-
strcpy(branch, "trunk");
1103-
strcpy(shortbranch, "trunk");
1104-
}
1105-
else if (istag || strncmp(br_start, "branches", 8) == 0) {
1106-
len = br_end2 - br_start;
1107-
strncpy(branch, br_start, len);
1108-
branch[len] = '\0';
1109-
1110-
len = br_end2 - (br_end + 1);
1111-
strncpy(shortbranch, br_end + 1, len);
1112-
shortbranch[len] = '\0';
1113-
}
1114-
else {
1115-
Py_FatalError("bad HeadURL");
1116-
return;
1117-
}
1118-
}
1119-
1120-
1121-
svnversion = _Py_svnversion();
1122-
if (strcmp(svnversion, "Unversioned directory") != 0 && strcmp(svnversion, "exported") != 0)
1123-
svn_revision = svnversion;
1124-
else if (istag) {
1125-
len = strlen(_patchlevel_revision);
1126-
assert(len >= 13);
1127-
assert(len < (sizeof(patchlevel_revision) + 13));
1128-
strncpy(patchlevel_revision, _patchlevel_revision + 11,
1129-
len - 13);
1130-
patchlevel_revision[len - 13] = '\0';
1131-
svn_revision = patchlevel_revision;
1132-
}
1133-
else
1134-
svn_revision = "";
1135-
11361080
svn_initialized = 1;
1081+
*patchlevel_revision = '\0';
1082+
strcpy(branch, "");
1083+
strcpy(shortbranch, "unknown");
1084+
svn_revision = "";
11371085
}
11381086

11391087
/* Return svnversion output if available.

0 commit comments

Comments
 (0)