Default to the current branch
* tool/make-snapshot: default to the current branch if no branch but srcdir is given.
This commit is contained in:
parent
8fb77acac7
commit
d819d97cf0
@ -143,7 +143,7 @@ end
|
|||||||
unless destdir = ARGV.shift
|
unless destdir = ARGV.shift
|
||||||
abort usage
|
abort usage
|
||||||
end
|
end
|
||||||
revisions = ARGV.empty? ? ["trunk"] : ARGV
|
revisions = ARGV.empty? ? [nil] : ARGV
|
||||||
unless tmp = $exported
|
unless tmp = $exported
|
||||||
FileUtils.mkpath(destdir)
|
FileUtils.mkpath(destdir)
|
||||||
destdir = File.expand_path(destdir)
|
destdir = File.expand_path(destdir)
|
||||||
@ -201,10 +201,12 @@ end
|
|||||||
def package(vcs, rev, destdir, tmp = nil)
|
def package(vcs, rev, destdir, tmp = nil)
|
||||||
patchlevel = false
|
patchlevel = false
|
||||||
prerelease = false
|
prerelease = false
|
||||||
if revision = rev[/@(\d+)\z/, 1]
|
if rev and revision = rev[/@(\d+)\z/, 1]
|
||||||
rev = $`
|
rev = $`
|
||||||
end
|
end
|
||||||
case rev
|
case rev
|
||||||
|
when nil
|
||||||
|
url = nil
|
||||||
when /\Atrunk\z/
|
when /\Atrunk\z/
|
||||||
url = vcs.trunk
|
url = vcs.trunk
|
||||||
when /\Abranches\//
|
when /\Abranches\//
|
||||||
@ -234,7 +236,10 @@ def package(vcs, rev, destdir, tmp = nil)
|
|||||||
warn "#{$0}: unknown version - #{rev}"
|
warn "#{$0}: unknown version - #{rev}"
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
revision ||= vcs.get_revisions(url)[0]
|
if !revision and revision = vcs.get_revisions(url)
|
||||||
|
url ||= vcs.branch(revision[3])
|
||||||
|
revision = revision[0]
|
||||||
|
end
|
||||||
version = nil
|
version = nil
|
||||||
unless revision
|
unless revision
|
||||||
url = vcs.trunk
|
url = vcs.trunk
|
||||||
|
@ -278,6 +278,7 @@ class VCS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def branch(name)
|
def branch(name)
|
||||||
|
return trunk if name == "trunk"
|
||||||
url + "branches/#{name}"
|
url + "branches/#{name}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user