summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-22 19:45:07 (GMT)
committerCollin Winter <collinw@gmail.com>2007-08-22 19:45:07 (GMT)
commitd5a5f5d32e7d8ba22f6a0b849875c23880269390 (patch)
tree1a6752260ce08d4eec44438670a638558949142b /Python
parent4d9620a6873453768288d94c65939bec773af5aa (diff)
downloadcpython-d5a5f5d32e7d8ba22f6a0b849875c23880269390.zip
cpython-d5a5f5d32e7d8ba22f6a0b849875c23880269390.tar.gz
cpython-d5a5f5d32e7d8ba22f6a0b849875c23880269390.tar.bz2
Patch #1774414: make it possible to use SVK to develop Python.
Diffstat (limited to 'Python')
-rw-r--r--Python/sysmodule.c58
1 files changed, 30 insertions, 28 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 542e624..7b32f60 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -934,41 +934,43 @@ svnversion_init(void)
{
const char *python, *br_start, *br_end, *br_end2, *svnversion;
Py_ssize_t len;
- int istag;
+ int istag = 0;
if (svn_initialized)
return;
python = strstr(headurl, "/python/");
- if (!python)
- Py_FatalError("subversion keywords missing");
-
- 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';
+ if (!python) {
+ strcpy(branch, "unknown branch");
+ strcpy(shortbranch, "unknown");
}
else {
- Py_FatalError("bad HeadURL");
- return;
+ 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;
+ }
}