comparison mercurial/commands.py @ 4068:5b1f663ef86d

Merge with stable
author Matt Mackall <mpm@selenic.com>
date Tue, 06 Feb 2007 16:12:22 -0600
parents 431f3c1d3a37 5d9ede002453
children e6d26e71f049
comparison
equal deleted inserted replaced
4062:516f883e3d79 4068:5b1f663ef86d
2484 2484
2485 Apply a compressed changegroup file generated by the bundle 2485 Apply a compressed changegroup file generated by the bundle
2486 command. 2486 command.
2487 """ 2487 """
2488 if os.path.exists(fname): 2488 if os.path.exists(fname):
2489 f = open(fname) 2489 f = open(fname, "rb")
2490 else: 2490 else:
2491 f = urllib.urlopen(fname) 2491 f = urllib.urlopen(fname)
2492 gen = changegroup.readbundle(f, fname) 2492 gen = changegroup.readbundle(f, fname)
2493 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) 2493 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname)
2494 return postincoming(ui, repo, modheads, opts['update']) 2494 return postincoming(ui, repo, modheads, opts['update'])
3067 3067
3068 for mod, name in added: 3068 for mod, name in added:
3069 uisetup = getattr(mod, 'uisetup', None) 3069 uisetup = getattr(mod, 'uisetup', None)
3070 if uisetup: 3070 if uisetup:
3071 uisetup(ui) 3071 uisetup(ui)
3072 reposetup = getattr(mod, 'reposetup', None)
3073 if reposetup:
3074 hg.repo_setup_hooks.append(reposetup)
3072 cmdtable = getattr(mod, 'cmdtable', {}) 3075 cmdtable = getattr(mod, 'cmdtable', {})
3073 overrides = [cmd for cmd in cmdtable if cmd in table] 3076 overrides = [cmd for cmd in cmdtable if cmd in table]
3074 if overrides: 3077 if overrides:
3075 ui.warn(_("extension '%s' overrides commands: %s\n") 3078 ui.warn(_("extension '%s' overrides commands: %s\n")
3076 % (name, " ".join(overrides))) 3079 % (name, " ".join(overrides)))
3150 if cmd not in norepo.split(): 3153 if cmd not in norepo.split():
3151 try: 3154 try:
3152 if not repo: 3155 if not repo:
3153 repo = hg.repository(u, path=path) 3156 repo = hg.repository(u, path=path)
3154 u = repo.ui 3157 u = repo.ui
3155 for name in external.itervalues():
3156 mod = sys.modules[name]
3157 if hasattr(mod, 'reposetup'):
3158 mod.reposetup(u, repo)
3159 hg.repo_setup_hooks.append(mod.reposetup)
3160 except hg.RepoError: 3158 except hg.RepoError:
3161 if cmd not in optionalrepo.split(): 3159 if cmd not in optionalrepo.split():
3162 raise 3160 raise
3163 d = lambda: func(u, repo, *args, **cmdoptions) 3161 d = lambda: func(u, repo, *args, **cmdoptions)
3164 else: 3162 else: