our $remotename = 'dgit';
our $ourdscfield = 'Vcs-git-master';
+our $branchprefix = 'dgit';
-sub uploadbranch () { return "dgit/$suite"; }
+sub uploadbranch () { return "$branchprefix/$suite"; }
sub lref ($) { return "refs/heads/$_[0]"; }
sub rref ($) { return "refs/remotes/$remotename/$_[0]"; }
sub debiantag ($) { return "debian/$_[0]"; }
# returns 0 or 1
my $cmd=
"ssh $alioth_sshtestbodge->[0] '".
- " set -e; cd /git/dgit-test;".
+ " set -e; cd $aliothpath;".
" if test -d $package.git; then echo 1; else echo 0; fi".
"'";
#print DEBUG "$cmd\n";
$authline =~ m/^[^<>]+ \<\S+\> \d+ [-+]\d+$/ or die $authline;
open C, ">../commit.tmp" or die $!;
print C "tree $tree\n" or die $!;
- print C "parent $upload_hash\n" or die $! if defined $upload_hash;
+ print C "parent $upload_hash\n" or die $! if $upload_hash;
print C <<END or die $!;
author $authline
committer $authline
cmdoutput qw(git log -n2), $commithash;
# ... gives git a chance to complain if our commit is malformed
my $outputhash = $commithash;
- if (defined $upload_hash) {
+ if ($upload_hash) {
chdir "$ud/$dir" or die $!;
runcmd qw(git reset --hard), $upload_hash;
runcmd qw(sh -ec), 'dpkg-parsechangelog >>../changelogold.tmp';
my $hash;
if (defined $dsc_hash) {
die "missing git history even though dsc has hash"
- unless length $upload_hash;
+ unless $upload_hash;
$hash = $dsc_hash;
ensure_we_have_orig();
} else {
$hash = generate_commit_from_dsc();
}
- if (length $upload_hash) {
+ if ($upload_hash) {
die "not fast forward on last upload branch!".
" (archive's version left in DGIT_ARCHIVE)"
unless is_fast_fwd($dsc_hash, $upload_hash);
print "last upload to archive has NO git hash\n";
}
my $dstdir = "$package";
+ my $branch = uploadbranch();
if (check_for_git()) {
print "cloning existing git history\n";
- runcmd qw(git clone --origin),$remotename, qw(-b), $suite, '--',
+ runcmd qw(git clone --origin),$remotename, qw(-b), $branch, '--',
$alioth_git, $dstdir;
chdir "$dstdir" or die "$dstdir $!";
fetch_from_archive();
print H "ref: ".lref(uploadbranch())."\n" or die $!;
close H or die $!;
runcmd qw(git remote add), $remotename, $alioth_git;
- runcmd "git config branch.$suite.remote $remotename";
- runcmd "git config branch.$suite.merge ".lref(uploadbranch());
+ runcmd "git config branch.$branch.remote $remotename";
+ runcmd "git config branch.$branch.merge ".lref(uploadbranch());
my $newhash = generate_commit_from_dsc();
runcmd qw(git reset --hard), $newhash;
}
}
sub fetch () {
+ get_archive_dsc();
if (check_for_git()) {
runcmd qw(git fetch -p),$remotename,
'+refs/heads/*:refs/remotes/origin/*';
sub branchsuite () {
my $branch = `git-symbolic-ref HEAD`;
- if ($branch =~ m#^refs/heads/dgit/([^/.]+)$#) {
+ if ($branch =~ m#^refs/heads/$branchprefix/([^/.]+)$#o) {
return $1;
} else {
return undef;