Commit Graph

8322 Commits

Author SHA1 Message Date
Mads Kiilerich
dbffdfd960 tag: invalidate tag cache immediately after adding new tag (issue3210)
New tags were written to .hgtags / .hglocaltags without updating or
invalidating the localrepo cache.

Before 462e6cfb1bac a lock was acquired soon after the new tags had been
written, and that invalidated the cache so the new tags for example could be
seen in pretxncommit hooks. With 462e6cfb1bac the lock had already been
acquired at this point and the missing cache invalidation was exposed.

The tag caches will now explicitly and immediately be invalidated when new tags
are added.
2012-01-19 02:14:06 +01:00
Matt Mackall
464b6bafef wireproto: refuse to lookup secret csets 2012-01-18 20:00:48 -06:00
Pierre-Yves David
7448ca3281 phases: mechanism to allow extension to alter initial computation of phase
This commit add a whennodata list where extension can register a callback to be
called if no phase related data are found in the repository.

The goal is to ensure the existing extension that move phase data in 2.1 can
compute consistent phase boundary for existing repo.
2012-01-18 17:23:54 +01:00
Pierre-Yves David
3dfd3d6ee3 config: have a way to backup and restore value in config
This is introduce to allow temporary overwriting of a config value while being
able to reinstall the old value once done. The main advantage over using
``config`` and ``setconfig`` is that backup and restore will properly restore
the lack of any config. Restoring the fact that there was no value is important
to allow config user to keep using meaniful default value.

A more naive approach will result in the following scenario::

  Before:
    config(section, item, my_default) --> my_default

  temporal overwrite
    old = config(section, item)
    …
    setconfig(section, item, old)

  After
    config(section, item, my_default) --> None

The first user of this feature should be mq to overwriting minimal phase of
future commit.
2012-01-18 16:52:26 +01:00
David M. Carr
560a2fff89 forget: fix subrepo recursion for explicit path handling
When support for handling explicit paths in subrepos was added to the forget
command (155b89136ae7), subrepo recursion wasn't taken into account.  This
change fixes that by pulling the majority of the logic of commands.forget into
cmdutil.forget, which can then be called from both there and subrepo.forget.
2012-01-17 19:10:59 -05:00
David M. Carr
375e0ca3cf add: fix subrepo recursion for explicit path handling
When support for handling explicit paths in subrepos was added to the add
command (825c4cefde4b), subrepo recursion wasn't taken into account.  This
change adds an explicitonly argument to cmdutil.add to allow controlling which
levels of recursion should include only explicit paths versus all matched
paths.
2012-01-17 19:10:58 -05:00
Matt Mackall
eb2ed976cb bookmarks: backout locking change in 31cb6aaf3b7a
Repo lock only applies to data in .hg/store/
2012-01-18 14:56:52 -06:00
Pierre-Yves David
1b001a85f3 changeset_printer: display changeset phase on debug level
Backward compatibility make it hard to display it on higher level
2012-01-17 20:23:23 +01:00
Pierre-Yves David
1b049b22f5 phase: report phase movement
When used in "set" mode, the phase command now display the number of changeset
who changed phase.
2012-01-17 20:43:41 +01:00
Matt Mackall
d2ef9d821b revset: roots needs to be computed on full set 2012-01-17 17:48:59 -06:00
Sune Foldager
e577300102 phases: use nodemap to check for missing nodes 2012-01-18 16:46:15 +01:00
Henrik Stuart
1b54292744 repair: move phases code after invalidation code 2012-01-18 14:50:17 +01:00
Matt Mackall
f3e58790bb revset: optimize roots and children 2012-01-16 01:21:30 -06:00
Matt Mackall
0c33089f33 revset: optimize building large lists in formatrevspec
The large or-expressions we used to build required a substantial
amount of subset filtering in orset() which was inefficient. Instead we build a
single string which we process in one go with a special internal predicate.
2012-01-16 01:21:22 -06:00
Matt Zuba
60b19beb18 hooks: prioritize run order of hooks
As of Mercurial 1.3, hooks are sorted in the order they are read into
Mercurial.  There are many instances when someone may want the hooks
sorted in a specific order; this patch allows prioritizing hooks, while
maintaining the existing enumeration for hooks without a priority.
2012-01-15 13:50:12 -07:00
Matt Mackall
8985b466e0 merge with stable 2012-01-15 18:00:01 -06:00
Christian Ebert
4fcf579deb filectx: typo in comment 2012-01-15 13:39:09 +01:00
Jordi Gutiérrez Hermoso
b28181a568 merge: report all files in _checkunknown
When doing hg up, if there is a file conflict with untracked files,
currently only the first such conflict is reported. With this patch,
all of them are listed.

With this patch error message is now reported as

    a: untracked file differs
    b: untracked file differs
    abort: untracked files in working directory conflict with files in
    requested revision

instead of

    abort: untracked file in working directory differs from file in
    requested revision: 'a'

This is a follow up to an old attempt to do this here:

    http://selenic.com/pipermail/mercurial-devel/2011-August/033625.html
2012-01-11 15:53:42 -05:00
Pierre-Yves David
a728162c9a discovery: fix prepush documentation
The prepush documentation claim that when we refuse to push, the second element
of the returng tuple is an "outgoing" integer. value should be 0 when no
outgoing changeset and 1 otherwise.  In pratice if there are no outgoing
changeset, "outgoing" value is alway 1 and util.Abort is raised on other error.

the stable branch also include this error so it wasn't introduced by a recent
refactoring.
2012-01-13 22:16:01 +01:00
Pierre-Yves David
387f9b40ba phases: simplify phase exchange and movement over pushkey
The code now only exchange draft root and only care about movement related to
public//draft boundary.

There is multiple reason to simplify this code:
    * Secret are never discovered anymore
    * We decided to not support more the three existing phase

Removing phase index from pushkey (if ever decided) will be made in another commit.
2012-01-13 02:04:16 +01:00
Pierre-Yves David
913d4ce095 phases: move phase according what was pushed not only what was added added
This fix the lack phase movement when a locally secret changeset without added
children was pushed to the repository. In such case, this changeset would be
present in the bundle source, but not in the ``added`` variable.
2012-01-13 01:42:47 +01:00
Pierre-Yves David
15ab7ccd15 revlog: make addgroup returns a list of node contained in the added source
This list will contains any node see in the source, not only the added one.
This is intended to allow phase to be move according what was pushed by client
not only what was added.
2012-01-13 01:29:03 +01:00
Pierre-Yves David
2b8de7b6ac phases: make secret changeset undiscoverable in all case
This apply the redefined stronger semantic of secret.

Secret changeset can still leak in various way. Those leak will need to be fixed individualy
2012-01-12 01:25:57 +01:00
Pierre-Yves David
a04b3a6ec3 phases: exclude secret when doing a local clone
This is achieved by denying copy clone when any secret changeset exist.
2012-01-11 17:26:27 +01:00
Mads Kiilerich
50c2110b65 bookmarks: primarily use repo lock, not wlock
Bookmarks are repository data, not working directory data. Only the current
bookmark is working directory data.

Some lock shuffling is required to avoid lockout between the initial mock lock
and locking of the localrepo instance that is created after copying.
2012-01-13 02:30:43 +01:00
Mads Kiilerich
460db57ad0 localrepo: update branchcache in a more reliable way
test-mq-cache.t did apparently look at stale cache content.

Testing with different locking mechanism happened to update the cache more
frequently and thus caused a test failure.
2012-01-13 02:29:38 +01:00
Mads Kiilerich
59e986bbed localrepo: remove spurious updatebranchcache return value
- it was left over from the refactoring in 670bb7b1924a.
2012-01-13 01:19:08 +01:00
Yuya Nishihara
0bf3f9f6fd filectx: fix cmp() of file starting with '\1\n'
If file data starts with '\1\n', it will be escaped in the revlog to
create an empty metadata block, thus adding four bytes to the size in
the revlog size index. There's no way to detect that this has happened
in filelog.size() faster than decompressing each revision [1].

For filectx.cmp(), we have the size of the file in the working directory
available. If it differs by exactly four bytes, it may be this case, so
do a full comparison.

 [1]: http://markmail.org/message/5akdbmmqx7vq2fsg
2012-01-12 00:49:45 +09:00
Mads Kiilerich
71865d2b26 tag: lock before tagging 2012-01-13 01:19:07 +01:00
Mads Kiilerich
98451cba89 debugbuilddag: lock repo before starting transaction 2012-01-13 01:19:07 +01:00
Matt Mackall
e0479875b3 merge with stable 2012-01-13 11:29:53 -06:00
Olav Reinert
c5f1adceef help: fix column alignment in "hg help" output
The output of "hg help" is changed to ensure that the column containing
descriptions of commands, extensions, and other topics is correctly alignmened.
2012-01-11 18:14:55 +01:00
Olav Reinert
cfc7a5074e minirst: simplify and standardize field list formatting
The default width of field lists is changed from 12 to 14 to align minirst with
the rst2html tool. Shrinking the width of the left column to fit the content is
removed, to keep formatting simple and uniform.
2012-01-11 18:08:25 +01:00
Martin Geisler
1c373fe3fb commands: partial backout of 50aa11ad0b77 2012-01-13 14:52:47 +01:00
Martin Geisler
5f85497f3f phase: add metavar to -r help text 2012-01-13 11:53:51 +01:00
Martin Geisler
03f35c36c9 phase: the REV argument can be repeated 2012-01-13 11:50:06 +01:00
Martin Geisler
4c9bf5eec4 commands: no need to rename merge and phases on import 2012-01-13 11:38:49 +01:00
Martin Geisler
f194db061a phase: there is actually no -C option 2012-01-13 11:34:09 +01:00
Martin Geisler
312014ab5d phase: use standard syntax for command line flags
We don't mark them as literal text and we mention the short option the
first time we talk about a given flag.
2012-01-13 11:29:47 +01:00
Martin Geisler
c8fd9fad8f phase: fix RST markup (use `...` for literal text) 2012-01-13 11:26:24 +01:00
Martin Geisler
57ec63f3c0 phase: lowercase option help, rephrase slightly 2012-01-13 11:23:45 +01:00
Pierre-Yves David
32c99d5daa phases: make outgoing object and discovery aware of exclusion
The outgoing object gains an "excluded" members holding all changesets which
were excluded because there where secret.

The core discovery code now remove secret changeset from discovery by default.
This means that any command relying on discovery will exclude secret changeset.
Most notable one are outgoing and bundle. (But bundle with and explicit
``--base`` still allow to bundle outgoing changeset.
2012-01-11 00:27:46 +01:00
Martin Geisler
303e7dc672 filesets: use example with quotes for encoding predicate
A user on IRC was confused that "encoding(ASCII)" works and
"encoding(UTF-8)" fails with "parse error: encoding requires an
encoding name".
2012-01-10 15:20:16 +01:00
Pierre-Yves David
e929cd5e49 discovery: introduce outgoing object for result of findcommonoutgoing
Simplifies client logic in multiple places since it encapsulates the
computation of the common and, more importantly, the missing node lists.

This also allows an upcomping patch to communicate precomputed versions of
these lists to clients.
2012-01-09 03:47:16 +01:00
Pierre-Yves David
2362e6fe6c commands: make bundle use heads computed by findoutgoing 2012-01-09 04:16:00 +01:00
Pierre-Yves David
a51dc67424 revlog: improve docstring for findcommonmissing 2012-01-09 04:15:31 +01:00
Martin Geisler
e0542a7108 commands: bump copyright year 2012-01-11 15:51:02 +01:00
Matt Mackall
7ea3d8e9f3 phase: mark messages for i18n 2012-01-10 16:36:36 -06:00
Matt Mackall
7025e1c3b0 phase: fix up help string 2012-01-10 16:36:33 -06:00
Matt Mackall
ae28263f4b phase: drop reference to working directory phase 2012-01-10 16:36:32 -06:00