On 15.05.2009 20:13, Adrian Buehlmann wrote:
> # HG changeset patch
> # User Adrian Buehlmann <[email protected]>
> # Date 1242410615 -7200
> # Node ID e6a71090bb50c0af3f1a56a54660edd5be6221b7
> # Parent 9de5a3d6d776fc457341f272e714861ce42c230b
> thgutil/shlib: add function update_thgstatus
>
> diff --git a/thgutil/shlib.py b/thgutil/shlib.py
> --- a/thgutil/shlib.py
> +++ b/thgutil/shlib.py
> @@ -13,6 +13,7 @@ import cPickle
> import time
> from mercurial.i18n import _
> from mercurial import util
> +from mercurial import dispatch
>
> class SimpleMRUList(object):
> def __init__(self, size=10, reflist=[], compact=True):
> @@ -150,6 +151,9 @@ def version():
> except ImportError:
> return _('unknown')
>
> +def update_thgstatus():
> + dispatch.dispatch(['thgstatus'] + ['--delay'])
> +
> if os.name == 'nt':
> def shell_notify(paths):
> try:
>
Hmm. Maybe we should not try to call the extension via dispatch
anymore and instead put the whole implementation into shlib, i.e. doing:
def update_thgstatus(repo):
tref = time.time()
tdelta = float(int(tref)) + 1.0 - tref
if (tdelta > 0.0):
time.sleep(tdelta)
repostate = repo.status()
modified, added, removed, deleted, unknown, ignored, clean = repostate
dirstatus = {}
for fn in added:
dirstatus[dirname(fn)] = 'a'
for fn in modified:
dirstatus[dirname(fn)] = 'm'
for fn in removed:
dirstatus[dirname(fn)] = 'r'
f = open(cachefilepath(repo), 'wb')
for dn in sorted(dirstatus):
e = dirstatus[dn] + dn + '\n'
f.write(e)
showentry(ui.note, e)
f.close()
Like this, we would be independent of cwd woes and use the repo object
instead.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop