Skip to content

Commit

Permalink
Bug 388944 - client.py can't produce tamarin repo URL from a ssh:// h…
Browse files Browse the repository at this point in the history
…g repo URL
  • Loading branch information
Unknown committed Jul 20, 2007
1 parent a009f62 commit 32ae2d1
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@
'security/coreconf',
'security/dbm')

# URL of the default hg repository to clone for Tamarin. If this is a
# relative URL, it's resolved relative to the Mozilla hg repository.
#
DEFAULT_TAMARIN_REPO = 'tamarin-central'
# URL of the default hg repository to clone for Tamarin.
DEFAULT_TAMARIN_REPO = 'http://hg.mozilla.org/tamarin-central/'

import os
import sys
from optparse import OptionParser
from ConfigParser import SafeConfigParser
import urlparse

topsrcdir = os.path.dirname(__file__)
if topsrcdir == '':
Expand Down Expand Up @@ -99,27 +95,7 @@ def fixup_repo_options(options):
# Handle special case: initial checkout of Tamarin.
if (options.tamarin_repo is None
and not os.path.exists(os.path.join(topsrcdir, 'js', 'tamarin'))):
# Calculate default tamarin source repository URL.

# Since DEFAULT_TAMARIN_REPO may be a relative URL, we first
# need to find the mozilla source repository URL, moz_repo.
moz_repo = options.mozilla_repo
if moz_repo is None:
cp = SafeConfigParser()
cp.read([os.path.join(topsrcdir, '.hg', 'hgrc')])
try:
moz_repo = cp.get("paths", "default")
except:
print ("*** Internal error: Expected to find a 'default' "
"setting in the [paths] section of .hg/hgrc; "
"but it's not there.")
raise

# Trim the standardsly-correct trailing /, if present.
if moz_repo.endswith('/'):
moz_repo = moz_repo[:-1]
options.tamarin_repo = urlparse.urljoin(moz_repo, DEFAULT_TAMARIN_REPO)

options.tamarin_repo = DEFAULT_TAMARIN_REPO

try:
(options, (action,)) = o.parse_args()
Expand Down

0 comments on commit 32ae2d1

Please sign in to comment.