+ value = config.get('branch.%s.remote' % self.__name)
+ if value:
+ return value
+ elif 'origin' in git.remotes_list():
+ # FIXME: this is for compatibility only. Should be
+ # dropped when all relevant commands record this info.
+ return 'origin'
+ else:
+ raise StackException, 'Cannot find a parent remote for "%s"' % self.__name