Commit Graph

8336 Commits

Author SHA1 Message Date
Pierre-Yves David
bcece1636b phase: fix warning text from invalid remote phase
add missing end of line and substitution.
2012-01-20 19:18:09 +01:00
Pierre-Yves David
f813e53446 mq-safety: don't apply safety on non-outgoing changeset
When mq changeset are secret, they don't appear in outgoing and won't be
pushed. So it's not necessary to abort the push.

The checkpush call is protected by lock to prevent race on phase.
2012-01-20 18:45:29 +01:00
Pierre-Yves David
fa04c4b2de phases: properly register excluded changeset when revision are specified
There was no other drawback than a bad UI message for now.
2012-01-20 00:27:11 +01:00
Matt Mackall
e52f0054ce bookmarks: make -i summary simpler and more accurate 2012-01-20 14:19:13 -06:00
Matt Mackall
7eeb2f277f revset: allow slashes in symbols
suggested by Ryan Kelly
2012-01-20 14:18:51 -06:00
Wagner Bruna
ce7ff22344 phases: do not mark debug message for translation 2012-01-20 13:19:32 -02:00
Wagner Bruna
ec5d06f3b6 templatekw: fix phase keywords 2012-01-20 13:10:01 -02:00
Wagner Bruna
2034ccc9cf phases: fix typo in warning message 2012-01-20 12:57:13 -02:00
Kevin Bullock
c4ab5bfe8b bookmarks: clarify help for -i/--inactive 2012-01-19 16:05:01 -06:00
Wagner Bruna
4d98f252a4 revset: fix typo in message 2012-01-20 13:19:39 -02:00
Matt Mackall
06e236e8f8 revset: add remote() predicate to lookup remote revisions 2012-01-19 14:31:05 -06:00
Matt Mackall
0e96c1d311 bookmarks: automatically advance bookmark on naked update (BC) (issue2894) 2012-01-19 14:07:48 -06:00
Pierre-Yves David
78c5d64e2e phases: only synchronize on common changeset when push fails
If push failed we should not expect the pushed changeset to exist on remote.
The common set before the push is used for phase related operation instead of
common + missing.

Note:
  * We still pull phase data even if push fails
  * We still try to push data even if push fails (same than bookmark)
2012-01-19 16:09:43 +01:00
Pierre-Yves David
a445988112 discovery: diet discovery.prepush from non-discovery code
The ``discovery.prepush`` function was doing multiple things not related to
discovery. This changeset move some code into the ``localrepo.push`` method. The
old ``discovery.prepush`` function jobs is now restricted to checking for
multple head creation. It was then renamed ``discovery.checkheads``.

This new ``discovery.checkheads`` function may receive several other changes in
the future but we are a bit too much near the freeze for a wider refactoring.
2012-01-19 15:50:55 +01:00
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