Commit Graph

72 Commits

Author SHA1 Message Date
timeless@mozdev.org
52eae47139 spelling: behaviour -> behavior 2015-08-28 10:53:55 -04:00
Gregory Szorc
7af3081f5e tags: explicitly log which tags cache file is being written
We now have multiple tags cache files. Record exactly which file is
being written. This should help aid debugging into performance issues
with any single filter.
2015-04-16 11:59:36 -04:00
Gregory Szorc
0f9537f76f tags: change format of tags cache files
.hgtags fnodes are now written to a shared cache file. They don't need
to exist in the per-filter tags cache files. Stop writing them.

The format of the tags cache file has changed in a backwards
incompatible way. This should be acceptable, as we just established
per-filter tags cache files and no client should have per-filter tags
cache files that will need to be read. So no backwards compatbility
concern is present.

The new format has a single header line followed by resolved tags
entries.

The header line is similar to the old first line with a major
difference: we now compute and store a hash of the filtered revisions.
Before, if the set of filtered revs changed, we may return incorrect
results. We now detect that.

A test for verifying filtered rev change is handled properly has been
added.
2015-04-16 12:01:00 -04:00
Pierre-Yves David
99746dff73 tags: have a different cache file per filter level
Currently whichever filter level asks for tags last will write the data on disk.
This create massive issues when tags are read for "visible" and "unfiltered"
on large and multi headed repository (like Mozilla central). See issue4550 for
details

Each filter level recomputes its own cache without direct collaboration but they
all share the same 'hgtagsfnodes' cache. And that is where most of the time is
spent.
2015-04-15 18:34:34 -04:00
Yuya Nishihara
610665ea76 commands: say "working directory" in full spelling 2015-03-17 21:53:17 +09:00
Durham Goode
2591767a70 bundles: do not overwrite existing backup bundles (BC)
Previously, a backup bundle could overwrite an existing bundle and cause user
data loss. For instance, if you have A<-B<-C and strip B, it produces backup
bundle B-backup.hg. If you then hg pull -r B B-backup.hg and strip it again, it
overwrites the existing B-backup.hg and C is lost.

The fix is to add a hash of all the nodes inside that bundle to the filename.
Fixed up existing tests and added a new test in test-strip.t
2015-01-09 10:52:14 -08:00
Mads Kiilerich
7167031347 localrepo: show headline notes in commitctx before showing filenames
commitctx already showed notes with filenames but didn't provide any context.
It is just as relevant to know when manifest or changelog is committed.

So, in addition to filenames, also show headlines 'committing files:',
'committing manifest' and 'committing changelog'.
2014-04-18 13:33:20 +02:00
Yuya Nishihara
ed7051c6c7 tests: write hgrc of more than two lines by using shell heredoc
Here document should be readable than repeating echo commands.
2014-11-04 23:41:46 +09:00
Mads Kiilerich
523c87c1fe spelling: fixes from proofreading of spell checker issues 2014-04-17 22:47:38 +02:00
Pierre-Yves David
4c446d7e00 mq: do not call [0] on revset
The __getitem__ method have been removed. The "first" method is to be used
instead. Test have been extended to test this code path.
2014-11-01 22:59:37 +00:00
Pierre-Yves David
2463533597 addset: fix first and last on sorted addset (issue4426)
The lazy sorting were not enforced on addset. This was made visible through MQ.
2014-11-01 22:58:30 +00:00
Pierre-Yves David
2213bfcae4 revset-_descendant: rework the whole sorting and combining logic
We use the & operator to combine with subset (since this is more likely to be
optimised than filter) and we enforce the sorting of the result. Without this
enforced sorting, we may result in a different iteration order than the set
_descendent was computed from.

This reverts a bad `test-glog.t` change from 7904906883bd.

Another side effect is that `test-mq.t` shows `qparent::` including `-1` if
`qparent is -1`. This sound like a positive change.

This has good and bad impacts on the benchmarks, here is a good ones:

revset: 0::
before) wall 0.045489 comb 0.040000 user 0.040000 sys 0.000000 (best of 100)
after)  wall 0.034330 comb 0.030000 user 0.030000 sys 0.000000 (best of 100)

revset: roots((0::) - (0::tip))
before)  wall 0.134090 comb 0.140000 user 0.140000 sys 0.000000 (best of 63)
after) wall 0.128346 comb 0.130000 user 0.130000 sys 0.000000 (best of 69)

revset: ::p1(p1(tip))::
before) wall 0.143892 comb 0.140000 user 0.140000 sys 0.000000 (best of 55)
after)  wall 0.124502 comb 0.130000 user 0.130000 sys 0.000000 (best of 65)

revset: roots((0:tip)::)
before) wall 0.204966 comb 0.200000 user 0.200000 sys 0.000000 (best of 43)
after) wall 0.184455 comb 0.180000 user 0.180000 sys 0.000000 (best of 47)

Here is a bad one:

revset: (20000::) - (20000)
before) wall 0.009592 comb 0.010000 user 0.010000 sys 0.000000 (best of 222)
after)  wall 0.029837 comb 0.030000 user 0.030000 sys 0.000000 (best of 100)
2014-10-09 09:12:54 -07:00
Matt Mackall
d2e240d48e help: normalize helplist hints 2014-08-12 04:11:32 -05:00
Pierre-Yves David
9a065a615c mq: extract strip function as its standalone extension (issue3824)
Strip now lives in its own extension

reminder: The extension is surprisingly called `strip`.  The `mq` extension
force the use of the strip extension when its enabled. This is both necessary
for backward compatibility (people expect `mq` to comes with strip) and become
some utility function used by `mq` are now in the strip extension.
2013-09-26 23:57:21 +02:00
Mads Kiilerich
ff9b442263 tests: work around msys bash mangling of paths in test-mq.t 2013-02-26 21:04:50 +01:00
Pierre-Yves David
853b87cfc0 mq: comply with filtering when injecting fake tags (issue3812)
mq was injecting fake tags whenever the revisions were accessible
to the filtering level.

This issue impacts hgweb since it's common to have "secret" mq
patches. As secret changesets are filtered by hgweb, the tags
computation could break.
2013-02-11 16:21:48 +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
Matt Mackall
28b6ee7d27 status: use condwrite to avoid zero-width format string hack 2012-11-06 17:30:47 -06:00
Mads Kiilerich
ccfffc07ba tests: add missing no-outer-repo requirements
Outer repos (if any) will now never be touched by the tests. But it is better
to run without any repos around the tmp directory.
2012-06-20 23:41:21 +02:00
Martin Geisler
a987a9f256 purge: lowercase messages 2012-06-12 14:18:18 +02:00
Mads Kiilerich
9355854f8a tests: cleanup of tests that got lost in their own nested directories
Some tests ended up in a directory several directories deeper than $TESTTMP,
usually because some 'cd ..' had been forgotten between different test cases.

Add 'cd ..' where they are missing so the tests get back where they started.
2012-06-11 01:38:32 +02:00
Mads Kiilerich
4f14a0a969 tests: convert some 'hghave execbit' to #if
This enables some new tests for running on windows.
2012-06-10 14:14:05 +02:00
Patrick Mezard
0e75723add mq: rename --check into --keep-changes
I named it --check because it felt like qpush & co were checking *more*
things to ensure local changes could not be lost. But it has been
pointed on the mailing list that --check is already used by update
command with a meaning almost opposite to this one. An alternative
was --keep but qfold and qdelete already have such an option to preserve
patch files and qfold may be a candidate for --check.

- qpush/qpop/qgoto --check becomes --keep-changes.
- mq.check becomes mq.keepchanges.
- The short option -c is dropped as -k may conflict with existing
  --keep. The availabilitity of mq.keepchanges should not make this too
  painful.
- Fix minor reST mistake in option description.
2012-05-13 14:00:58 +02:00
Patrick Mezard
f06b17a700 mq: introduce mq.check setting
When:

  [mq]
  check = True

is set, qpush, qpop and qgoto behave as if -c/--check were passed. If
incompatible options like -f/--force or --exact are set, this setting is
ignored.

This setting enables what many users expect mq default behaviour to be.
2012-05-12 00:19:30 +02:00
Patrick Mezard
d775dd04bb mq: backup local changes in qpush --force
qpush help says the following about --force:
1- When -f/--force is applied, all local changes in patched files will
   be lost.
2- Apply on top of local changes

In practice, qpush --force will attempt to apply the patch on top of
local changes, and on success will merge them in the pushed patch. On
failure, patched files will contain a mix of local changes (where the
patch could not apply) and a mix of patch changes (were it applied). So,
local changes are less lost than entangled with a mass of other changes.

This patch makes qpush --force backup all locally modified files touched
by the next patch being applied. When multiple patches are being pushed,
this logic is repeated for each patch. Note that modified but
successfully patched files are preserved as well.
2012-05-11 16:18:47 +02:00
Matt Mackall
309ca70823 merge stable 2012-04-01 15:34:22 -05:00
FUJIWARA Katsunori
18786dc9ad tests: fix portability of sed usage in test-mq
on some platform (Mac OS X and Solaris, at least), to insert new text
line, sed function 'i' should be followed by:

  - backslash('\'),
  - new-line,
  - text to be inserted and
  - new-line

GNU sed on Linux can recognize both previous and new ones as same
modification request.

in addition to it, this patch avoids to use '-i' option for sed,
because it is not so portable, as noted in WritingTests wiki page.
2012-04-01 18:18:48 +09:00
Matt Mackall
73319d495a merge with stable 2012-03-31 14:05:10 -05:00
Matt Mackall
bd79d24af7 tests: fix portability of sed expression in test-mq 2012-03-31 13:46:46 -05:00
Matt Mackall
5a705b3a5d merge with stable 2012-03-30 14:35:06 -05:00
Mads Kiilerich
08bbe3eb2b mq: fix qpush --move with comments in series file between applied patches
The 'start' variable pointed to qtip in self.series, but it was used for
indexing self.fullseries.

When fullseries had holes and the patch was moved to self.fullseries[start]
it would end up too early in self.series and it could thus not be
found in self.series[start:] and it would crash.

Now the 'fullstart' index in fullseries is found used instead.
2012-03-29 00:35:00 +02:00
Matt Mackall
7f2dc15daf merge with stable 2012-03-27 14:37:17 -05:00
Pierre-Yves David
a6a8d8d05e qfinish: comply with the phases.new-commit option in secret mode (issue3335)
In secret mode qfinished changeset were move to the draft phase in all case[1]
without regard to phases.new-commit value

This changeset ensure qfinish does not automatically promote a changeset
further than the phases.new-commit value.

Note: This may also result in qfinished changeset made public if
phases.new-commit is set to public.

[1] "In all case" where parent have a compatible phase. Qfinish keep never
    altering phases of changeset not involved in the qfinish.
2012-03-24 12:06:49 +01:00
Patrick Mezard
9d058db6bd mq: fix qapplied --last and qprev documentation (issue3282)
qapplied --last is qprev not qtop.

v2:
- Replace "previous" with "preceding" as suggested here and there
2012-02-27 18:23:18 +01:00
Matt Mackall
38ab0032cb merge with stable 2012-02-28 21:17:53 -06:00
Matt Mackall
272058d456 mq: expand qimport summary 2012-02-22 17:41:22 -06:00
Patrick Mezard
b7f936bb8a mq: make qprev return the previous applied patch (issue3245)
The current behaviour is to return the previous one in the series but at the
same time the implementation is buggy because it does not take guarded patches
in account.
2012-02-03 19:47:09 +01:00
Patrick Mezard
0b8c39f5e8 mq: fix qnext when all remaining patches are guarded
When all remaining patches are guarded, qnext used to return the last of the
queue anyway.
2012-02-03 19:38:31 +01:00
Patrick Mezard
33314514c3 test-mq: fix sed call on OSX
- The regular sed on OSX wants: -i "" not -i""
- GNU sed wants: -i"" not -i ""

Backups are fine.
2012-02-03 19:23:13 +01:00
Matt Mackall
94245d0910 mq: fix secret description in help 2012-01-30 16:04:14 -06:00
Pierre-Yves David
13fe947391 qfinish: do not set secret changeset to draft if mq.secret=false
If mq.secret=false, mq should not touch phase
2012-01-30 15:17:08 +01:00
Pierre-Yves David
24ebf577e2 mq: take mq.secret configuration into account when picking the default phase 2012-01-30 17:39:05 +01:00
Matt Mackall
f549014354 mq: add secret setting 2012-01-29 12:59:21 -06: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
3025e16875 mq: have mq create secret changeset only 2012-01-18 16:53:49 +01: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
FUJIWARA Katsunori
8a4c96d3b4 icasefs: add test for case preservation on case insensitive filesystem
"hg qpush" causes unexpected behavior, if case preservation on case
insensitive filesystem is not enough.

this patch adds the test using mixed-case filenames to reproduce this
problem on any case insensitive filesystems.
2011-12-24 19:16:36 +09:00
Mads Kiilerich
8c22a0ec28 tests: make (glob) on windows accept \ instead of /
Globbing is usually used for filenames, so on windows it is reasonable and very
convenient that glob patterns accepts '\' or '/' when the pattern specifies
'/'.
2011-11-07 03:25:10 +01:00
Mads Kiilerich
adfff587c7 tests: use 'hghave execbit' for tests that manipulate x bit in file system 2011-11-07 03:14:54 +01:00
Idan Kamara
73a82e0b84 backout of a52e14fe37fb: allow to qpop/push with a dirty working copy
The new behavior was breaking existing tools that relied on a sequence such as
this:

1) start with a dirty working copy
2) qimport some patch
3) try to qpush it
4) old behavior would fail at this point due to outstanding changes.
   (new behavior would only fail if the outstanding changes and the patches
   changes intersect)
5) innocent user qrefreshes, gets his local changes in the imported patch

It's worth considering if we can move this behavior to -f in the future.
2011-06-24 23:25:42 +03:00