[PATCH] Fix issue 1719, inotify dirstate when dirty (v2: improved matching + extended test)

Simon Heimberg simohe at besonet.ch
Sat Aug 15 17:34:03 CDT 2009


Sorry, there is one line too much in test-inotify-dirty.py. (Forgotten
to delete a line copied from hghave.) It is marked below.
I will resend the patch but I wait for some feedback first.

Am Samstag, den 15.08.2009, 23:50 +0200 schrieb Simon Heimberg:
> # HG changeset patch
> # User Simon Heimberg <simohe at besonet.ch>
> # Date 1250372350 -7200
> # Node ID 68874a314191de4a27fbf817fc857d5770a62932
> # Parent  bde485306b9dd5c8ea8fd9ee939d8879833689d6
> inotify: when dirstate is dirty, force local state (fix issue1719)
> 
[snip]
> diff -r bde485306b9d -r 68874a314191 tests/test-inotify-dirty.py
> --- /dev/null	Don Jan 01 00:00:00 1970 +0000
> +++ b/tests/test-inotify-dirty.py	Sam Aug 15 23:39:10 2009 +0200
> @@ -0,0 +1,83 @@
> +#!/bin/env python
> +
> +'Test inotify status while wlock is held (=dirstate is dirty)'
> +
> +import os, time, sys
> +from mercurial import hg, extensions, ui, match
> +
> +def pstatus(match, ignored=False, clean=False, unknown=False):
> +    res = repo.dirstate.status(match, ignored, clean, unknown)
> +    for st, files in zip('LMARDUIC', res):
> +        if files:
> +            print '%s: %s' % (st, ','.join(files)),
> +    print ''
> +
> +def pnstatus(match):
> +    pstatus(match, True)
> +    pstatus(match, True, True)
> +    pstatus(match, True, True, True)
> +    pstatus(match, True, False, True)
> +    pstatus(match, False, True)
> +
> +u = ui.ui()
> +if os.environ.get('HG_TEST_NO_INOTIFY'):
> +    print '#### test without inotify' # for generating correct out file
> +else:
> +    extensions.load(u, 'inotify', '')
> +    try:
> +        import hgext.inotify.linux.watcher

---- delete the following line 
> +        return True


> +    except ImportError:
> +        sys.stderr.write('missing feature: inotify extension support\n')
> +        sys.exit(80)
> +
> +os.mkdir('r')
> +open('r/.hgignore', 'w').write('.hgignore\n')
> +
> +repo = hg.repository(u, 'r', create=True)
> +
[snip]


More information about the Mercurial-devel mailing list