diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1512,6 +1512,8 @@ def init(ui, repo, **opts): if r: if not os.path.exists(r.wjoin('.hgignore')): fp = r.wopener('.hgignore', 'w') + fp.write('^\\.hg\n') + fp.write('^\\.mq\n') fp.write('syntax: glob\n') fp.write('status\n') fp.write('guards\n') diff --git a/tests/test-mq.out b/tests/test-mq.out --- a/tests/test-mq.out +++ b/tests/test-mq.out @@ -70,6 +70,8 @@ A series A test.patch % qinit; qinit -c .hgignore: +^\.hg +^\.mq syntax: glob status guards