summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-09-29 11:35:47 +0200
committerErich Eckner <git@eckner.net>2018-09-29 11:35:47 +0200
commit7bcef03ec70e6a128c608b029bdfbf3ca7ae87db (patch)
treeb0907bcb012c89e7e25652b29bee3098eec2722b
parent497ce6bb79ba1133db166f2bf1bc9e4daff05286 (diff)
downloadarchive-server-7bcef03ec70e6a128c608b029bdfbf3ca7ae87db.tar.xz
httpdocs/index.php: serve hg tar balls
-rw-r--r--httpdocs/index.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/httpdocs/index.php b/httpdocs/index.php
index b519fe3..941fee9 100644
--- a/httpdocs/index.php
+++ b/httpdocs/index.php
@@ -87,10 +87,23 @@ if (isset($_GET['r'])) {
}
if ($_GET['t']=='git')
$handle = popen(
- 'git -C "../work/repositories/' . $_GET['t'] . '/' . $_GET['r'] . '" archive' . $prefix . ' "' . $commit_identifier . '" | ' .
+ 'git -C "' . $wok_dir . 'repositories/' . $_GET['t'] . '/' . $_GET['r'] . '"' .
+ ' archive' .
+ $prefix .
+ ' "' . $commit_identifier . '" | ' .
'gzip -nc',
'r'
);
+ elseif ($_GET['t']=='hg')
+ $handle = popen(
+ 'hg archive' .
+ ' -t tgz' .
+ $prefix .
+ ' -R "' . $work_dir . 'repositories/' . $_GET['t'] . '/' . $_GET['r'] . '"' .
+ ' -r "' . $commit_identifier . '"' .
+ ' /dev/stdout',
+ 'r'
+ );
else
$handle = false;
if ($handle === false)