fetch,parse-remote,fmt-merge-msg: refs/remotes/* support

We can now easily fetch and merge things from heads in the
refs/remotes/ hierarchy in remote repositories.

The refs/remotes/ hierarchy is likely to become the standard for
tracking foreign SCMs, as well as the location of Pull: targets
for tracking remote branches in newly cloned repositories.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Eric Wong
2006-03-10 04:19:07 -08:00
committed by Junio C Hamano
parent f2561fda36
commit 687b8be8bb
3 changed files with 20 additions and 6 deletions

View File

@ -75,6 +75,7 @@ while (<>) {
$src{$src} = {
BRANCH => [],
TAG => [],
R_BRANCH => [],
GENERIC => [],
# &1 == has HEAD.
# &2 == has others.
@ -91,6 +92,11 @@ while (<>) {
push @{$src{$src}{TAG}}, $1;
$src{$src}{HEAD_STATUS} |= 2;
}
elsif (/^remote branch (.*)$/) {
$origin = $1;
push @{$src{$src}{R_BRANCH}}, $1;
$src{$src}{HEAD_STATUS} |= 2;
}
elsif (/^HEAD$/) {
$origin = $src;
$src{$src}{HEAD_STATUS} |= 1;
@ -123,6 +129,8 @@ for my $src (@src) {
}
push @this, andjoin("branch ", "branches ",
$src{$src}{BRANCH});
push @this, andjoin("remote branch ", "remote branches ",
$src{$src}{R_BRANCH});
push @this, andjoin("tag ", "tags ",
$src{$src}{TAG});
push @this, andjoin("commit ", "commits ",