Skip to content

Commit

Permalink
Do a better job of figuring out which remote to pull from
Browse files Browse the repository at this point in the history
  • Loading branch information
toddlipcon committed May 29, 2009
1 parent 8248df7 commit 44ac313
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,16 @@ def from_dict(name, data, remotes, default_remote):
my_remotes = dict([ (r, remotes[r])
for r in my_remote_names])

from_remote = data.get('from-remote', default_remote)
from_remote = data.get('from-remote')
if not from_remote:
if len(my_remote_names) == 1:
from_remote = my_remote_names[0]
elif default_remote in my_remote_names:
from_remote = default_remote
else:
raise Exception("no from-remote listed for project %s, and more than one remote" %
name)

assert from_remote in my_remote_names
return Project(name=name,
remotes=my_remotes,
Expand Down

0 comments on commit 44ac313

Please sign in to comment.