Mercurial > hg
view tests/test-hgwebdir-paths.py @ 25795:69145daacdfa
cmdutil: allow callers of cmdutil.dorecord to omit suggestion
Interactive committing under non-interactive mode shows command
suggestion, but sometimes it is meaningless.
command suggestion usability
------------ ---------- -----------
record commit
commit -i commit meaningless
qrecord qnew
qnew -i qnew meaningless
qrefersh -i qrefresh meaningless
shelve -i commit incorrect
------------ ---------- -----------
This patch allows callers of 'cmdutil.dorecord()' to omit meaningless
suggestion by passing None or so for 'cmdsuggest' argument of it.
This is a preparation for subsequent patches, which fix each
suggestion issues above.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 15 Jul 2015 03:43:16 +0900 |
parents | c519cd8f0169 |
children | 4eac86331acb |
line wrap: on
line source
import os from mercurial import hg, ui from mercurial.hgweb.hgwebdir_mod import hgwebdir os.mkdir('webdir') os.chdir('webdir') webdir = os.path.realpath('.') u = ui.ui() hg.repository(u, 'a', create=1) hg.repository(u, 'b', create=1) os.chdir('b') hg.repository(u, 'd', create=1) os.chdir('..') hg.repository(u, 'c', create=1) os.chdir('..') paths = {'t/a/': '%s/a' % webdir, 'b': '%s/b' % webdir, 'coll': '%s/*' % webdir, 'rcoll': '%s/**' % webdir} config = os.path.join(webdir, 'hgwebdir.conf') configfile = open(config, 'w') configfile.write('[paths]\n') for k, v in paths.items(): configfile.write('%s = %s\n' % (k, v)) configfile.close() confwd = hgwebdir(config) dictwd = hgwebdir(paths) assert len(confwd.repos) == len(dictwd.repos), 'different numbers' assert len(confwd.repos) == 9, 'expected 9 repos, found %d' % len(confwd.repos) found = dict(confwd.repos) for key, path in dictwd.repos: assert key in found, 'repository %s was not found' % key assert found[key] == path, 'different paths for repo %s' % key