Mercurial > hg
changeset 10342:579aae5aa549
zeroconf: override default destination folder on clone
author | Henrik Stuart <hg@hstuart.dk> |
---|---|
date | Sat, 06 Feb 2010 17:31:49 +0100 |
parents | c203878e58ba |
children | b8e3aeb7542c |
files | hgext/zeroconf/__init__.py |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/zeroconf/__init__.py Sat Feb 06 17:37:52 2010 +0100 +++ b/hgext/zeroconf/__init__.py Sat Feb 06 17:31:49 2010 +0100 @@ -24,7 +24,7 @@ ''' import Zeroconf, socket, time, os -from mercurial import ui +from mercurial import ui, hg, encoding from mercurial import extensions from mercurial.hgweb import hgweb_mod from mercurial.hgweb import hgwebdir_mod @@ -156,7 +156,14 @@ repos += getzcpaths() return repos +def defaultdest(orig, source): + for name, path in getzcpaths(): + if path == source: + return name.encode(encoding.encoding) + return orig(source) + extensions.wrapfunction(ui.ui, 'config', config) extensions.wrapfunction(ui.ui, 'configitems', configitems) +extensions.wrapfunction(hg, 'defaultdest', defaultdest) hgweb_mod.hgweb = hgwebzc hgwebdir_mod.hgwebdir = hgwebdirzc