# HG changeset patch # User Matt Mackall # Date 2012-05-13 10:52:24 # Node ID d947e1da12597090d71c3d97ec224b7aa5513330 # Parent 26756d9d8143e18ddc998f491a8a016fa62a2e0c # Parent 40cdf8bc8d4037405e52a1a2c491c3fb54153575 merge with stable diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -2137,12 +2137,11 @@ def qimport(ui, repo, *filename, **opts) rev=opts.get('rev'), git=opts.get('git')) finally: q.savedirty() - - - if imported and opts.get('push') and not opts.get('rev'): - return q.push(repo, imported[-1]) finally: lock.release() + + if imported and opts.get('push') and not opts.get('rev'): + return q.push(repo, imported[-1]) return 0 def qinit(ui, repo, create): diff --git a/i18n/pt_BR.po b/i18n/pt_BR.po --- a/i18n/pt_BR.po +++ b/i18n/pt_BR.po @@ -3110,13 +3110,13 @@ msgid "http authentication with factotum msgstr "autenticação http com factotum" msgid "" -"This extension allows the factotum facility on Plan 9 from Bell Labs platforms\n" -"to provide authentication information for HTTP access. Configuration entries\n" -"specified in the auth section as well as authentication information provided\n" -"in the repository URL are fully supported. If no prefix is specified, a value\n" -"of ``*`` will be assumed." -msgstr "" -"Esta extensão permite que o recurso factotum nas plataformas\n" +"This extension allows the factotum(4) facility on Plan 9 from Bell Labs\n" +"platforms to provide authentication information for HTTP access. Configuration\n" +"entries specified in the auth section as well as authentication information\n" +"provided in the repository URL are fully supported. If no prefix is specified,\n" +"a value of \"*\" will be assumed." +msgstr "" +"Esta extensão permite que o recurso factotum(4) nas plataformas\n" "Plan 9 from Bell Labs forneçam informação de autenticação para\n" "acesso HTTP. Entradas de configuração especificadas na seção\n" "auth bem como informações de autenticação fornecidas na URL do\n" @@ -12139,6 +12139,13 @@ msgstr "" " Veja :hg:`help revisions` e :hg:`help revsets` para mais\n" " informações sobre a especificação de revisões." +msgid "" +" See :hg:`help templates` for more about pre-packaged styles and\n" +" specifying custom templates." +msgstr "" +" Veja :hg:`help templates` para mais informações sobre estilos\n" +" pré-existentes e especificação de modelos personalizados." + msgid "revision to display" msgstr "revisão a ser exibida" @@ -14826,9 +14833,7 @@ msgid "" " keys contain PATH-like strings, every part of which must reference\n" " a ``Mercurial.ini`` file or be a directory where ``*.rc`` files will\n" " be read. Mercurial checks each of these locations in the specified\n" -" order until one or more configuration files are detected. If the\n" -" pywin32 extensions are not installed, Mercurial will only look for\n" -" site-wide configuration in ``C:\\Mercurial\\Mercurial.ini``." +" order until one or more configuration files are detected." msgstr "" " Arquivos de configuração por instalação e sistema, para o sistema\n" " no qual o Mercurial está instalado.\n" @@ -14839,10 +14844,7 @@ msgstr "" " diretório do qual arquivos ``*.rc`` serão lidos.\n" " O Mercurial verifica cada uma destas localizações na ordem\n" " especificada até que um ou mais arquivos de configuração sejam\n" -" encontrados.\n" -" Se as extensões pywin32 não estiverem instaladas, o Mercurial\n" -" procurará por arquivos de configuração de sistema apenas em\n" -" ``C:\\Mercurial\\Mercurial.ini``." +" encontrados." msgid "" "Syntax\n" @@ -17599,6 +17601,27 @@ msgstr "" " Habilita suporte a cache na interface hgweb. O padrão é True." msgid "" +"``collapse``\n" +" With ``descend`` enabled, repositories in subdirectories are shown at\n" +" a single level alongside repositories in the current path. With\n" +" ``collapse`` also enabled, repositories residing at a deeper level than\n" +" the current path are grouped behind navigable directory entries that\n" +" lead to the locations of these repositories. In effect, this setting\n" +" collapses each collection of repositories found within a subdirectory\n" +" into a single entry for that subdirectory. Default is False." +msgstr "" +"``collapse``\n" +" Com ``descend`` habilitado, repositórios em subdiretórios são\n" +" exibidos em um único nível junto com repositórios no caminho\n" +" atual. Com ``collapse`` também habilitado, repositórios que\n" +" residam em um nível mais profundo que o caminho atual são\n" +" agrupados atrás de entradas de diretório navegáveis que levam\n" +" às localizações desses repositórios. Ou seja, esta\n" +" configuração colapsa cada coleção de repositórios encontrada\n" +" em um subdiretório em uma única entrada para esse\n" +" subdiretório. O padrão é False." + +msgid "" "``contact``\n" " Name or email address of the person in charge of the repository.\n" " Defaults to ui.username or ``$EMAIL`` or \"unknown\" if unset or empty." @@ -22727,6 +22750,12 @@ msgid "subrepo spec file %s not found" msgstr "arquivo spec de sub-repositório %s não encontrado" #, python-format +msgid "invalid subrepository revision specifier in .hgsubstate line %d" +msgstr "" +"especificador de revisão de sub-repositório inválido na linha %d do arquivo " +".hgsubstate" + +#, python-format msgid "bad subrepository pattern in %s: %s" msgstr "padrão ruim de sub-repositório em %s: %s" diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -910,7 +910,10 @@ def show_changeset(ui, repo, opts, buffe if not (tmpl or style): tmpl = ui.config('ui', 'logtemplate') if tmpl: - tmpl = templater.parsestring(tmpl) + try: + tmpl = templater.parsestring(tmpl) + except SyntaxError: + tmpl = templater.parsestring(tmpl, quoted=False) else: style = util.expandpath(ui.config('ui', 'style', '')) diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -390,7 +390,7 @@ class localrepository(repo.repository): # ignore tags to unknown nodes self.changelog.rev(v) t[k] = v - except error.LookupError: + except (error.LookupError, ValueError): pass return t @@ -906,6 +906,8 @@ class localrepository(repo.repository): l = self._lockref and self._lockref() if l: l.postrelease.append(callback) + else: + callback() def lock(self, wait=True): '''Lock the repository store (.hg/store) and return a weak reference @@ -1195,7 +1197,9 @@ class localrepository(repo.repository): finally: wlock.release() - self.hook("commit", node=hex(ret), parent1=hookp1, parent2=hookp2) + def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2): + self.hook("commit", node=node, parent1=parent1, parent2=parent2) + self._afterlock(commithook) return ret def commitctx(self, ctx, error=False): diff --git a/mercurial/parsers.c b/mercurial/parsers.c --- a/mercurial/parsers.c +++ b/mercurial/parsers.c @@ -785,7 +785,7 @@ static PyObject *index_getitem(indexObje if (PyInt_Check(value)) return index_get(self, PyInt_AS_LONG(value)); - if (PyString_AsStringAndSize(value, &node, &nodelen) == -1) + if (node_check(value, &node, &nodelen) == -1) return NULL; rev = index_find_node(self, node, nodelen); if (rev >= -1) @@ -868,12 +868,15 @@ static PyObject *index_partialmatch(inde static PyObject *index_m_get(indexObject *self, PyObject *args) { + Py_ssize_t nodelen; + PyObject *val; char *node; - int nodelen, rev; + int rev; - if (!PyArg_ParseTuple(args, "s#", &node, &nodelen)) + if (!PyArg_ParseTuple(args, "O", &val)) return NULL; - + if (node_check(val, &node, &nodelen) == -1) + return NULL; rev = index_find_node(self, node, nodelen); if (rev == -3) return NULL; @@ -892,11 +895,8 @@ static int index_contains(indexObject *s return rev >= -1 && rev < index_length(self); } - if (!PyString_Check(value)) - return 0; - - node = PyString_AS_STRING(value); - nodelen = PyString_GET_SIZE(value); + if (node_check(value, &node, &nodelen) == -1) + return -1; switch (index_find_node(self, node, nodelen)) { case -3: diff --git a/tests/test-command-template.t b/tests/test-command-template.t --- a/tests/test-command-template.t +++ b/tests/test-command-template.t @@ -45,6 +45,15 @@ Second branch starting at nullrev: $ hg mv second fourth $ hg commit -m third -d "2020-01-01 10:01" +Quoting for ui.logtemplate + + $ hg tip --config "ui.logtemplate={rev}\n" + 8 + $ hg tip --config "ui.logtemplate='{rev}\n'" + 8 + $ hg tip --config 'ui.logtemplate="{rev}\n"' + 8 + Make sure user/global hgrc does not affect tests $ echo '[ui]' > .hg/hgrc diff --git a/tests/test-hook.t b/tests/test-hook.t --- a/tests/test-hook.t +++ b/tests/test-hook.t @@ -101,9 +101,9 @@ tag hooks can see env vars precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a 4:539e4b31b6dc + tag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a commit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 commit.b hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 - tag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a $ hg tag -l la pretag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la tag hook: HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la diff --git a/tests/test-tag.t b/tests/test-tag.t --- a/tests/test-tag.t +++ b/tests/test-tag.t @@ -300,3 +300,16 @@ tagging on an uncommitted merge (issue25 t3 1:c3adabd1a5f4 local $ cd .. + +commit hook on tag used to be run without write lock - issue3344 + + $ hg init repo-tag + $ hg init repo-tag-target + $ hg -R repo-tag --config hooks.commit="hg push \"`pwd`/repo-tag-target\"" tag tag + pushing to $TESTTMP/repo-tag-target + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files +