Commit Graph

5939 Commits

Author SHA1 Message Date
Augie Fackler
807e21c5e0 test-symlink-os-yes-fs-no.py: clean up use of two-argument raise
This makes any attempt to port to Python 3 harder, and the new syntax
is supported in 2.4 already.
2013-01-01 13:21:15 -06:00
Augie Fackler
c5ef831d0d test-command-template.t: fix test so it all year
This test started failing for me after midnight UTC on December
31st. Fixed it by specifying a date 7 years in the future more
precisely (rather than just adding 8 to the year and specifying
January 1st), which allows the test to pass both now and on 2012-12-01
at the same time.
2012-12-31 21:50:35 -06:00
Pierre-Yves David
186fef84cd branchmap: improve invalid cache message when reading
This factors out the generation of the message. This helps future error reporting
when reading cache for filtered repository.
2012-12-28 00:13:32 +01:00
Pierre-Yves David
febbf1f08f histedit: allow operation from non-head if obsolete is enabled
Obsolescence markers can represent this situation just fine. Rewritten
revisions are marked as precursors of the ones creates by
histedit. Unaffected descendants become "unstable".

If obsolescence is not enabled we keep the current behavior of
aborting. This new behavior only applies when obsolete is
enabled and is subject to future discussion and changes.
2012-12-31 17:46:22 -06:00
Pierre-Yves David
5fe6f9df7f rebase: allow non-head rebase-set when obsolete is enabled
Obsolescence markers can represent this situation just fine. Rebased
revisions are marked as precursors of the ones create by
rebase. Unrebased descendants becomes "unstable".

If obsolescence is not enabled we keep the current behavior of
aborting. This new behavior only applies when obsolete is
enabled and is subject to future discussion and changes.
2012-12-31 17:45:52 -06:00
Pierre-Yves David
bc7f0f7ffa amend: allow amend of non-head when obsolete is enabled
Obsolescence marker can represent this situation just fine. The old
version is marked as precursor of the new changeset. All its
descendants become "unstable".

If obsolescence is not enabled we keep the current behavior of
aborting. This new behavior only applies when obsolete is
enabled and is subject to future discussion and changes.
2012-12-31 17:44:18 -06:00
Mads Kiilerich
6376600846 tests: fix windows test failures 2012-12-28 14:22:24 +01:00
Mads Kiilerich
9fcd0220e1 merge with stable 2012-12-28 14:13:06 +01:00
Mads Kiilerich
24be691647 tests: fix windows test failures 2012-12-28 14:10:35 +01:00
Mads Kiilerich
8e7cb5c68c largefiles: better test coverage of wireproto and the http protocol 2012-12-13 19:19:06 +01:00
Mads Kiilerich
9302004c43 largefiles: cleanup of warnings on errors getting largefiles
Especially the "no default or default-push path set in hgrc" was often very
misleading and didn't give any hint where it actually was looking.

A long error messages is better than several multi-line messages.
2012-12-13 19:19:06 +01:00
Mads Kiilerich
861c915f14 bundlerepo: don't return the peer without bundlerepo from getremotechanges
Problem:
getremotechanges would return the 'other' repo if nothing was incoming and
there thus wasn't any bundle to base the repo on. The 'other' could be a http
peer which only implement the functionality available over the http protocol.
Transplant could thus fail with
  TypeError: argument of type 'httppeer' is not iterable

Solution:
Return the local repo instead of the remote peer if there is no reason to place
a bundlerepo on top of the local repo.
2012-12-28 11:16:01 +01:00
Mads Kiilerich
a17080a566 bookmarks: fix head selection for merge with two bookmarked heads
A type mismatch caused the search for the other head to fail. The code is
fragile, and instead it ended up using the 'first' bookmark head, but the
ordering is undefined and it could thus randomly use the wrong bookmarkhead
and fail with:

  $ hg up -q -C e@diverged
  $ hg merge
  abort: merging with a working directory ancestor has no effect
2012-12-24 13:26:13 +01:00
Mads Kiilerich
20020a39e4 largefiles: introduce basic debugstate --large functionality
Very useful for debugging largefiles "performance" issues.

This is used for testing 45d039e26849.
2012-12-28 11:55:57 +01:00
Mads Kiilerich
056fcbf2bc merge with stable 2012-12-28 11:55:45 +01:00
Pierre-Yves David
fc633e8922 strip: do not update branchcache during strip (issue3745)
At this moment, the cache is invalid, and will be thrown away.
Later the strip function will call the `localrepo.destroyed` method
that will update the branchmap cache.
2012-12-28 00:02:40 +01:00
Siddharth Agarwal
28f04a41d2 copies: do not track backward copies, only renames (issue3739)
The inverse of a rename is a rename, but the inverse of a copy is not a copy.
Presenting it as such -- in particular, stuffing it into the same dict as real
copies -- causes bugs because other code starts believing the inverse copies
are real.

The only test whose output changes is test-mv-cp-st-diff.t. When a backwards
status -C command is run where a copy is involved, the inverse copy (which was
hitherto presented as a real copy) is no longer displayed.

Keeping track of inverse copies is useful in some situations -- composability
of diffs, for example, since adding "a" followed by an inverse copy "b" to "a"
is equivalent to a rename "b" to "a". However, representing them would require
a more complex data structure than the same dict in which real copies are also
stored.
2012-12-26 15:04:07 -08:00
Siddharth Agarwal
76d4a91eed copies: make debug messages more sensible
The -> in debug messages is currently overloaded to mean both source to dest
and dest to source. To fix this, we add explicit labels and make the arrow
direction consistent.
2012-12-26 15:03:58 -08:00
Kevin Bullock
4ca92b51d3 merge with stable 2012-12-26 11:16:18 -06:00
Pierre-Yves David
2e407bdb0d branchmap: move validity logic in the object itself
In several place, We check if a branchcache is still valid regarding the current
state of the repository. This changeset puts this logic in a method of the object
that can be reused when necessary.

A branch map is considered valid whenever it is up to date or a strict subset of
the repository state.

The change will help making branchcache aware of filtered revision.

The change in keyword is expected. the branch cache is actually invalid after
the amend. The previous check did not detected it.
2012-12-24 02:49:59 +01:00
Adrian Buehlmann
087143e7a1 test-pathencode: accept --seed parameter in hex as well
test-pathencode.py outputs the seed value in hex if it finds a deviation.

This change allows to specify the seed value as a command line
parameter for test-pathencode.py in hex as well.
2012-12-20 15:18:41 +01:00
Angel Ezquerra
586f53ce9d subrepo: append subrepo path to subrepo error messages
This change appends the subrepo path to subrepo errors. That is, when there
is an error performing an operation a subrepo, rather than displaying a message
such as:

pushing subrepo MYSUBREPO to PATH
searching for changes
abort: push creates new remote head HEADHASH!
hint: did you forget to merge? use push -f to force

mercurial will show:

pushing subrepo MYSUBREPO to PATH
searching for changes
abort: push creates new remote head HEADHASH! (in subrepo MYSUBREPO)
hint: did you forget to merge? use push -f to force

The rationale for this change is that the current error messages make it hard
for TortoiseHg (and similar tools) to tell the user which subrepo caused the
push failure.

The "(in subrepo MYSUBREPO)" message has been added to those subrepo methods
were it made sense (by using a decorator). We avoid appending "(in subrepo XXX)"
multiple times when subrepos are nexted by throwing a "SubrepoAbort" exception
after the extra message is appended. The decorator will then "ignore" (i.e. just
re-raise) the exception and never add the message again.

A small drawback of this method is that part of the exception trace is lost when
the exception is catched and re-raised by the annotatesubrepoerror decorator.

Also, because the state() function already printed the subrepo path when it
threw an error, that error has been changed to avoid duplicating the subrepo
path in the error message.

Note that I have also updated several subrepo related tests to reflect these
changes.
2012-12-13 23:37:53 +01:00
Kevin Bullock
f1b0314e82 tests: fix some slash-based Windows failures 2012-12-20 13:49:31 -06:00
Pierre-Yves David
ad4e0f7344 clfilter: use filtering in visibleheads
This is the second real use of changelog filtering. The change is very small to
allow testing the new filter with a setup close to the original one.

We replace custom post processing on `heads`function by call to the standard
code pass on a filtering repo.

In later coming will have wider usage of filtering that will make the dedicated
function useless.
2012-12-17 17:27:12 +01:00
Bryan O'Sullivan
4e26cae8ca tests: make test-inotify-issue1208.t disappear 2012-12-19 10:45:40 -08:00
Bryan O'Sullivan
e063b46f80 inotify: don't fall over just because of a dangling symlink
Previously, the inotify server failed to start if .hg/inotify.sock was
a symlink that pointed to a non-existent path. This behaviour does not
seem to make any sense.

Now, if we encounter a broken symlink, we unlink it and continue.
2012-12-18 17:33:32 -08:00
Bryan O'Sullivan
faf26b0d44 test-inotify: test symlink indirection for unix sockets
The inotify code performs a delicate dance to work around the 108-byte
limit on unix domain socket path names on Linux.

This change sets us up to safely refactor that code without breaking
it. (It is redundant with part of test-inotify-issue1208.t, but we will
shortly make that test go away.)
2012-12-19 10:40:34 -08:00
Adrian Buehlmann
de02c4573a test-pathencode: compare current pathencoding implementations
We already have two implementations of the pathencoding (C and
Python) and this test can perfectly well be used to probabilistically
test them instead of just wasting CPU cycles and test time.
2012-12-19 10:02:43 +01:00
Siddharth Agarwal
4fdbea480f ancestor: add lazy membership testing to lazyancestors
This also makes the perfancestorset command use lazy membership testing. In a
linear repository with over 400,000 commits, without this patch, hg
perfancestorset takes 0.80 seconds no matter how far behind we're looking.
With this patch, hg perfancestorset -- X takes:

    Rev X       Time
       -1      0.00s
    -4000      0.01s
   -20000      0.04s
   -80000      0.17s
  -200000      0.43s
  -300000      0.69s
        0      0.88s

Thus, for revisions close to tip, we're up to several orders of magnitude
faster. At 0 we're around 10% slower.
2012-12-18 12:47:20 -08:00
Pierre-Yves David
3c1bf60d66 test: fix truncated comment in test
The push is made to ensure repository are related. The comment in the initial
changeset got truncated somehow.
2012-12-17 17:00:24 +01:00
Siddharth Agarwal
6d5198a5a3 revlog.ancestors: add support for including revs
This is in preparation for an upcoming refactoring. This also fixes a bug in
incancestors, where if an element of revs was an ancestor of another it would
be generated twice.
2012-12-17 15:13:51 -08:00
Siddharth Agarwal
40a1b50c25 ancestor: move missingancestors doctest out into a separate file
This is in preparation for upcoming patches which will reuse the same graph
for tests.
2012-12-11 14:47:33 -08:00
Kevin Bullock
2deea1b073 commands: 'hg bookmark NAME' should work even with ui.strict=True
Before this patch, enabling strict command processing (ui.strict=True)
meant that 'hg bookmark NAME', as referenced several places in the
documentation, would not work. This adds 'bookmark' as an explicit alias
to 'bookmarks'.
2012-12-16 22:00:38 -06:00
Mads Kiilerich
0d873970f2 tests: improve test-mv-cp-st-diff.t readability 2012-12-16 19:41:56 +01:00
Levi Bard
5ac6c21477 largefiles: commit directories that only contain largefiles (issue3548)
If we pass a directory to commit whose only commitable files
are largefiles, the core commit code aborts before finding
the largefiles.
So we do the following:
For directories that only have largefiles as matches,
we explicitly add the largefiles to the matchlist and remove
the directory.
In other cases, we leave the match list unmodified.
2012-12-10 14:58:42 +01:00
Julien Cristau
2c91c44855 tests: don't hardcode errno==2 for ENOENT
Hurd seems to set ENOENT to 2 + 2**30, unlike everyone else.
2012-12-04 14:35:02 +01:00
FUJIWARA Katsunori
b81a7802fd subrepo: add argument to "diff()" to pass "ui" of caller side (issue3712) (API)
Color extension achieves colorization by overriding the class of
"ui" object just before command execution.

Before this patch, "diff()" of abstractsubrepo and classes
derived from it has no "ui" argument, so "diff()" of hgsubrepo
uses "self._repo.ui" to invoke "cmdutil.diffordiffstat()".

For separation of configuration between repositories, revision
1498948ee815 changed the initialization source of "self._repo.ui"
from "ui"(overridden) to "baseui"(plain) of parent repository.
And this caused break of colorization.

This patch adds "ui" argument to "diff()" of abstractsubrepo and
classes derived from it to pass "ui" object of caller side.
2012-11-30 00:43:55 +09:00
Pierre-Yves David
39909ce228 rebase: fix pull --rev options clashing with --rebase (issue3619)
Rebase also have a plain `--rev` option used to select the rebase set (as
`--base` or `--source` would). But the content of the --rev option was intended
for the remote repo and is irrelevant for the local rebase operation. We expect
`hg pull --rebase` to stick with the default behavior here:

    hg rebase --base . --dest tip(branch(.))

The `rev` option is dropped from the option passed to rebase.
2012-11-29 16:37:15 +01:00
Matt Mackall
d0aed02210 tests: fix broken fix of test-phases output 2012-11-28 17:53:52 -06:00
Tim Henigan
68a1fc4488 update: allow update to existing branches with invalid names (issue3710)
Starting with 049792af94d6, users are no longer able to update a
working copy to a branch named with a "bad" character (such as ':').

Prior to v2.4, it was possible to create branch names using "bad"
characters, so this breaks backwards compatibility.

Mercurial must allow users to update to existing branches with bad
names.  However, it should continue to prevent the creation of new
branches with bad names.

A test was added to confirm that 'hg update' works as expected. The
test uses a bundled repo that was created with an earlier version of
Mercurial.
2012-11-27 08:47:35 -05:00
Pierre-Yves David
292c83cd65 command: remove phase from the list of basic command
This is not a basic command. There is no reason new user should needs to know
about it. Thanks to Matt Mackall for pointing this.
2012-11-28 11:20:56 +01:00
André Sintzoff
94ef5e50d6 phases: fix missing "error" module import (issue3707) 2012-11-25 20:39:37 +01:00
Idan Kamara
4ae64fdb03 grep: don't search past the end of the searched string
'*' causes the resulting RE to match 0 or more repetitions of the preceding RE:

>>> bool(re.search('.*', ''))
>>> True

This causes an infinite loop because currently we're only checking if there was
a match without looking at where we are in the searched string.
2012-11-12 19:27:03 +02:00
Pierre-Yves David
cc961a38fb amend: force editor only if old message is reused (issue3698)
This regression was added by 435d13b1e757. It triggered the editor even if
--message or --logfile were provided.
2012-11-13 08:41:56 -08:00
Pierre-Yves David
2038eca723 obsolete: refuse to push divergent changeset
As other troubles `unstable` and `bumped`. Followup patches may simplify the
push code with unification of "obsolescence troubles" handling.
2012-11-10 02:19:20 +01:00
Pierre-Yves David
f3faf259c5 obsolete: add revset and test for divergent changesets
This changesets add a new `divergent()` revset similar to `unstable()` and
`bumped()` one. Introducting this revset allows actuall test of the divergent
detection.
2012-12-12 03:12:55 +01:00
Pierre-Yves David
70d5b32616 obsolete: drop successors sets which are subset of another one
If both "(B,)" and "(B, C)" are successors set of "A", "(B,)" is dropped.
We won't be interrested in detection such divergence scenario.
2012-11-10 01:56:59 +01:00
Pierre-Yves David
da22110fc6 obsolete: compute successors set
Successors set are an important part of obsolescence. It is necessary to detect
and solve divergence situation. This changeset add a core function to compute
them, a debug command to audit them and solid test on the concept.

Check function docstring for details about the concept.
2012-12-13 15:38:43 +01:00
Mads Kiilerich
f53a267ea1 mq: don't fail when removing a patch without patch file from series file 2012-12-09 00:25:21 +01:00
Mads Kiilerich
53f5b626ae largefiles: align rm warnings with warnings used in core 2012-12-13 19:19:06 +01:00