Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hg.py @ 2775:b550cd82f92a
Move merge code to its own module
Pull update and merge3 out of localrepo into merge.py
s/self/repo/
Add temporary API function in hg.py
Convert all users
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 03 Aug 2006 15:24:41 -0500 |
parents | 8cd3e19bf4a5 |
children | fdc232d8a193 |
line wrap: on
line diff
--- a/mercurial/hg.py Thu Aug 03 13:07:57 2006 -0500 +++ b/mercurial/hg.py Thu Aug 03 15:24:41 2006 -0500 @@ -10,7 +10,7 @@ from demandload import * from i18n import gettext as _ demandload(globals(), "localrepo bundlerepo httprepo sshrepo statichttprepo") -demandload(globals(), "errno lock os shutil util") +demandload(globals(), "errno lock os shutil util merge") def _local(path): return (os.path.isfile(path and util.drop_scheme('file', path)) and @@ -38,7 +38,7 @@ return thing(path) except TypeError: return thing - + def islocal(repo): '''return true if repo or path is local''' if isinstance(repo, str): @@ -200,8 +200,17 @@ dest_lock.release() if update: - dest_repo.update(dest_repo.changelog.tip()) + merge.update(dest_repo, dest_repo.changelog.tip()) if dir_cleanup: dir_cleanup.close() return src_repo, dest_repo + + +# This should instead be several functions with short arglists, like +# update/merge/revert + +def update(repo, node, allow=False, force=False, choose=None, + moddirstate=True, forcemerge=False, wlock=None, show_stats=True): + return merge.update(repo, node, allow, force, choose, moddirstate, + forcemerge, wlock, show_stats)