Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f1171209
Commit
f1171209
authored
Apr 20, 2011
by
Jesus Cea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Up-port changeset 5cf8f6da8743 (closes #11890)
parent
2ee75d55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
56 deletions
+4
-56
Python/sysmodule.c
Python/sysmodule.c
+4
-56
No files found.
Python/sysmodule.c
View file @
f1171209
...
...
@@ -1065,8 +1065,6 @@ settrace() -- set the global debug tracing function\n\
/* end of sys_doc */
;
/* Subversion branch and revision management */
static
const
char
_patchlevel_revision
[]
=
PY_PATCHLEVEL_REVISION
;
static
const
char
headurl
[]
=
"$HeadURL$"
;
static
int
svn_initialized
;
static
char
patchlevel_revision
[
50
];
/* Just the number */
static
char
branch
[
50
];
...
...
@@ -1076,64 +1074,14 @@ static const char *svn_revision;
static
void
svnversion_init
(
void
)
{
const
char
*
python
,
*
br_start
,
*
br_end
,
*
br_end2
,
*
svnversion
;
Py_ssize_t
len
;
int
istag
=
0
;
if
(
svn_initialized
)
return
;
python
=
strstr
(
headurl
,
"/python/"
);
if
(
!
python
)
{
strcpy
(
branch
,
"unknown branch"
);
strcpy
(
shortbranch
,
"unknown"
);
}
else
{
br_start
=
python
+
8
;
br_end
=
strchr
(
br_start
,
'/'
);
assert
(
br_end
);
/* Works even for trunk,
as we are in trunk/Python/sysmodule.c */
br_end2
=
strchr
(
br_end
+
1
,
'/'
);
istag
=
strncmp
(
br_start
,
"tags"
,
4
)
==
0
;
if
(
strncmp
(
br_start
,
"trunk"
,
5
)
==
0
)
{
strcpy
(
branch
,
"trunk"
);
strcpy
(
shortbranch
,
"trunk"
);
}
else
if
(
istag
||
strncmp
(
br_start
,
"branches"
,
8
)
==
0
)
{
len
=
br_end2
-
br_start
;
strncpy
(
branch
,
br_start
,
len
);
branch
[
len
]
=
'\0'
;
len
=
br_end2
-
(
br_end
+
1
);
strncpy
(
shortbranch
,
br_end
+
1
,
len
);
shortbranch
[
len
]
=
'\0'
;
}
else
{
Py_FatalError
(
"bad HeadURL"
);
return
;
}
}
svnversion
=
_Py_svnversion
();
if
(
strcmp
(
svnversion
,
"Unversioned directory"
)
!=
0
&&
strcmp
(
svnversion
,
"exported"
)
!=
0
)
svn_revision
=
svnversion
;
else
if
(
istag
)
{
len
=
strlen
(
_patchlevel_revision
);
assert
(
len
>=
13
);
assert
(
len
<
(
sizeof
(
patchlevel_revision
)
+
13
));
strncpy
(
patchlevel_revision
,
_patchlevel_revision
+
11
,
len
-
13
);
patchlevel_revision
[
len
-
13
]
=
'\0'
;
svn_revision
=
patchlevel_revision
;
}
else
svn_revision
=
""
;
svn_initialized
=
1
;
*
patchlevel_revision
=
'\0'
;
strcpy
(
branch
,
""
);
strcpy
(
shortbranch
,
"unknown"
);
svn_revision
=
""
;
}
/* Return svnversion output if available.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment