Indefero

Indefero Commit Details


Date:2011-03-25 05:08:18 (13 years 8 months ago)
Author:Sindre Myren
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, release-1.1, release-1.2, release-1.3
Commit:e518bc9b6804e07045a94ee736773140d2ea336f
Parents: 8e02d05ba9e1196a4e052054a9ac6dee3bbe76c5
Message:Updated gitserve.py to work with python 3.x

Changes:

File differences

scripts/gitserve.py
11
22
3
3
44
55
66
......
2323
2424
2525
26
27
26
27
28
29
30
31
32
33
2834
29
30
31
3235
3336
3437
35
38
3639
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
# ***** BEGIN LICENSE BLOCK *****
# This file is part of InDefero, an open source project management application.
# Copyright (C) 2008 CĂ©ondo Ltd and contributors.
import os
import sys
import commands
import traceback
import subprocess
SCRIPTDIR = os.path.abspath(__file__).rsplit(os.path.sep, 1)[0]
GITSERVEPHP = '%s/gitserve.php' % SCRIPTDIR
process = subprocess.Popen(['php', GITSERVEPHP, sys.argv[1]],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output = str.encode("\n").join(process.communicate()).strip()
status = process.wait()
n = len("/gitserve.py")
GITSERVEPHP = '%s/gitserve.php' % traceback.extract_stack(limit=1)[0][0][0:-n]
status, output = commands.getstatusoutput('php %s %s' % (GITSERVEPHP, sys.argv[1]))
if status == 0:
os.execvp('git', ['git', 'shell', '-c', output.strip()])
else:
sys.stderr.write("%s\n" % output)
sys.stderr.write("%s\n" % output.strip())
sys.exit(1)

Archive Download the corresponding diff file

Page rendered in 0.08103s using 13 queries.