def check_remotes(self): for name, commands in self.repos.iteritems(): checkout = commands['checkout'][0] if 'git' not in checkout: continue remotes = get_remotes(HOME + '/' + name) if 'origin' in remotes: o = remotes['origin'] if o in checkout: del remotes['origin'] else: print "ERROR: Origin not the checkout command for", name continue new_remotes = [] old_remotes = commands.get('remote', []) for line in old_remotes: a = PATTERN3.match(line) if a and a.group(1) in remotes: del remotes[a.group(1)] new_remotes = old_remotes if len(remotes)==0: continue print "==%s=="%name print remotes for remote in remotes: x = raw_input(remote + "?") if 'a' in x: print "Adding %s"%remote new_remotes.append(TEMPLATE % {'name': remote, 'url': remotes[remote]}) commands['remote'] = new_remotes
def test_get_remotes(self): remotes = git.get_remotes(".")