Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/hg.py @ 2899:bee4b7abcb01
Merge with crew
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 14 Aug 2006 14:42:15 -0500 |
parents | 345bac2bc4ec |
children | 3acb76f0124d |
comparison
equal
deleted
inserted
replaced
2898:06c05c675a35 | 2899:bee4b7abcb01 |
---|---|
1 # hg.py - repository classes for mercurial | 1 # hg.py - repository classes for mercurial |
2 # | 2 # |
3 # Copyright 2005 Matt Mackall <mpm@selenic.com> | 3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> |
4 # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> | |
4 # | 5 # |
5 # This software may be used and distributed according to the terms | 6 # This software may be used and distributed according to the terms |
6 # of the GNU General Public License, incorporated herein by reference. | 7 # of the GNU General Public License, incorporated herein by reference. |
7 | 8 |
8 from node import * | 9 from node import * |
46 return _lookup(repo).islocal(repo) | 47 return _lookup(repo).islocal(repo) |
47 except AttributeError: | 48 except AttributeError: |
48 return False | 49 return False |
49 return repo.local() | 50 return repo.local() |
50 | 51 |
52 repo_setup_hooks = [] | |
53 | |
51 def repository(ui, path=None, create=False): | 54 def repository(ui, path=None, create=False): |
52 """return a repository object for the specified path""" | 55 """return a repository object for the specified path""" |
53 return _lookup(path).instance(ui, path, create) | 56 repo = _lookup(path).instance(ui, path, create) |
57 for hook in repo_setup_hooks: | |
58 hook(ui, repo) | |
59 return repo | |
54 | 60 |
55 def defaultdest(source): | 61 def defaultdest(source): |
56 '''return default destination of clone if none is given''' | 62 '''return default destination of clone if none is given''' |
57 return os.path.basename(os.path.normpath(source)) | 63 return os.path.basename(os.path.normpath(source)) |
58 | 64 |