Commit Graph

9344 Commits

Author SHA1 Message Date
Matt Mackall
bf4fb1e322 templater: factor out runtemplate method
As a side-effect, this makes the output of runmap non-flattened
2012-09-22 13:02:33 -05:00
Matt Mackall
0dd30183db templating: make new-style templating features work with command line lists 2012-09-21 18:54:00 -05:00
David M. Carr
9e830e5477 formatter: improve implementation of data method
This alternate syntax was proposed by Bryan O'Sullivan in a review of
441ebe37ceb5.  I haven't been able to measure any particular performance
difference, but the new syntax is more concise and easier to read.
2012-09-20 23:30:59 -04:00
Bryan O'Sullivan
7a018d3dd7 Merge with crew-stable 2012-09-19 09:38:51 -07:00
FUJIWARA Katsunori
414d11165a bookmarks: use "changectx.descendant()" for efficient descendant examination
This patch uses "old.descendant(new)" expression instead of
"new in old.descendants()" for efficiency.
2012-09-18 21:39:12 +09:00
FUJIWARA Katsunori
f8ea001372 context: add "descendant()" to changectx for efficient descendant examination
This patch adds "descendant()", which uses "revlog.descendant()" for
descendant examination, to changectx.

This implementation is more efficient than "new in old.descendants()"
expression, because:

  - "changectx.descendants()" creates temporary "changectx" objects,
    but "revlog.descendant()" doesn't

    "revlog.descendant()" checks only revision numbers of descendants.

  - "revlog.descendant()" stops scanning, when scanning of all
    revisions less than one of examination target is finished

    this can avoid useless scanning in "not descendant" case.
2012-09-18 21:39:12 +09:00
FUJIWARA Katsunori
9701df1178 bookmarks: avoid redundant creation/assignment of "validdests" in "validdest()" 2012-09-18 21:39:12 +09:00
Adrian Buehlmann
666b8531e6 store: add a fallback _pathencode Python function
which does the equivalent of parsers.pathencode, so it can be used as a
default
2012-09-19 14:00:23 +02:00
Adrian Buehlmann
976f01af3f store: move _plainhybridencode and _dothybridencode higher up in the file
no functional change
2012-09-19 13:58:51 +02:00
Adrian Buehlmann
114ea39f3e store: fix _hashencode call in _dothybridencode
Fixes b9ebea2d1672
2012-09-19 11:39:07 +02:00
Bryan O'Sullivan
ed33f34e0c Merge with mpm 2012-09-18 16:30:21 -07:00
Bryan O'Sullivan
c85d8166d1 store: use native fncache encoding function if available
This currently falls back to Python for hashed encoding.
2012-09-18 16:25:20 -07:00
Bryan O'Sullivan
a150198558 store: implement fncache basic path encoding in C
(This is not yet enabled; it will be turned on in a followup patch.)

The path encoding performed by fncache is complex and (perhaps
surprisingly) slow enough to negatively affect the overall performance
of Mercurial.

For a short path (< 120 bytes), the Python code can be reduced to a fairly
tractable state machine that either determines that nothing needs to be
done in a single pass, or performs the encoding in a second pass.

For longer paths, we avoid the more complicated hashed encoding scheme
for now, and fall back to Python.

Raw performance: I measured in a repo containing 150,000 files in its tip
manifest, with a median path name length of 57 bytes, and 95th percentile
of 96 bytes.

In this repo, the Python code takes 3.1 seconds to encode all path
names, while the hybrid C-and-Python code (called from Python) takes
0.21 seconds, for a speedup of about 14.

Across several other large repositories, I've measured the speedup from
the C code at between 26x and 40x.

For path names above 120 bytes where we must fall back to Python for
hashed encoding, the speedup is about 1.7x.  Thus absolute performance
will depend strongly on the characteristics of a particular repository.
2012-09-18 15:42:19 -07:00
Bryan O'Sullivan
024c511c7b store: refactor hashed encoding into its own function 2012-09-18 14:37:32 -07:00
Adrian Buehlmann
fc4c657eab store: reuse direncoded path in _hybridencode
For a netbeans clone on Windows 7 x64:

  Before:
    $ hg perffncacheencode
    ! wall 3.516000 comb 3.525623 user 3.525623 sys 0.000000 (best of 3)

  After:
    $ hg perffncacheencode
    ! wall 3.443000 comb 3.447622 user 3.447622 sys 0.000000 (best of 3)
2012-09-18 19:51:59 +02:00
Adrian Buehlmann
6935b60c2a store: extract functions _encodefname and _decodefname 2012-09-18 19:51:48 +02:00
FUJIWARA Katsunori
e08cbc5b19 archival: add "extended-timestamp" extra block for zip archives (issue3600)
Before this patch, zip archives created by "hg archive" are extracted
with unexpected timestamp, if TZ is not configured as GMT.

This patch adds "extended-timestamp" extra block to zip archives, and
unzip will extract such archives with timestamp specified in added
extra block, even though TZ is not configured as GMT.

Please see documents below for detail about specification of zip file
format and "extended-timestamp" extra block:

  http://www.pkware.com/documents/casestudies/APPNOTE.TXT
  http://www.opensource.apple.com/source/zip/zip-6/unzip/unzip/proginfo/extra.fld

Original implementation of this patch was suggested by "Jun Omae
<jun66j5@gmail.com>".
2012-09-18 19:46:15 +09:00
Adrian Buehlmann
6123a70068 store: use fast C implementation of encodedir() if it's available
For a netbeans clone on Windows 7 x64:

  Encoding all paths in the fncache:

    Before:
      $ hg perffncacheencode
      ! wall 3.639000 comb 3.634823 user 3.634823 sys 0.000000 (best of 3)
    After:
      $ hg perffncacheencode
      ! wall 3.470000 comb 3.463222 user 3.463222 sys 0.000000 (best of 3)

  Writing fncache:

    Before:
      $ hg perffncachewrite
      ! wall 0.103000 comb 0.093601 user 0.093601 sys 0.000000 (best of 95)
    After:
      $ hg perffncachewrite
      ! wall 0.081000 comb 0.078001 user 0.062400 sys 0.015600 (best of 100)
2012-09-18 11:44:16 +02:00
Adrian Buehlmann
fd6785ba1c pathencode: new C module with fast encodedir() function
Not yet used (will be enabled in a later patch).

This patch is a stripped down version of patches originally created by
Bryan O'Sullivan <bryano@fb.com>
2012-09-18 11:43:30 +02:00
Adrian Buehlmann
2dfd0c409a store: add multiline doctest case for encodedir()
a followup to 7090b12b599b
2012-09-18 07:58:50 +02:00
Adrian Buehlmann
7bf349fd77 store: optimize fncache._load a bit by dirdecoding the contents in one go
For a netbeans clone on Windows 7 x64:

  Before:
    $ hg perffncacheload
    ! wall 0.124000 comb 0.124801 user 0.124801 sys 0.000000 (best of 76)

  After:
    $ hg perffncacheload
    ! wall 0.096000 comb 0.093601 user 0.078001 sys 0.015600 (best of 97)
2012-09-17 11:00:38 +02:00
Thomas Arendsen Hein
41c1ca4d45 wireproto: workaround for yield inside try/finally incompatible with python2.4 2012-09-18 17:00:58 +02:00
Adrian Buehlmann
039dd48b84 store: optimize fncache._write by direncoding the contents in one go
For a netbeans clone on Windows 7 x64:

  Before:
    $ hg perffncachewrite
    ! wall 0.210000 comb 0.218401 user 0.202801 sys 0.015600 (best of 47)

  After:
    $ hg perffncachewrite
    ! wall 0.104000 comb 0.109201 user 0.078000 sys 0.031200 (best of 95)
2012-09-17 08:58:35 +02:00
Adrian Buehlmann
c239e1837f store: move encode lambda logic into fncachestore
and define two named functions at module scope.

This again also speeds up perffncacheencode a little bit.
2012-09-16 11:41:02 +02:00
Adrian Buehlmann
e773964ca6 store: eliminate one level of lambda functions on _hybridencode 2012-09-16 11:36:14 +02:00
Adrian Buehlmann
bbb1196b99 store: parameter path of _auxencode is now a list of strings 2012-09-16 11:36:06 +02:00
Adrian Buehlmann
55185b8e33 store: keep an accumulated length for the shorted dirs in _hybridencode
so we don't have to repeatedly do  '/'.join(sdirs)  inside the loop
2012-09-16 11:36:00 +02:00
Adrian Buehlmann
1184227af0 store: reorder basename assignment in _hybridencode 2012-09-16 11:35:55 +02:00
David M. Carr
9b004d69e6 formatter: add base implementation of data method
Previously, nothing was done with the passed in values, which clearly wasn't
the intention.
2012-09-15 22:50:34 -04:00
Adrian Buehlmann
40f2dc614d store: remove uneeded startswith('data/') checks in encodedir() and decodedir()
I don't think we will ever have anything in the store that resides inside a
directory that ends in .i or .d under store/ that we wouldn't want to have
direncoded. The files not under data/ surely don't need direncoding, but it
doesn't harm to let these few run through it. It hurts more to check whether the
thousands of other files start with 'data/'. They do anyway.

See also 67e6074ba430 (fixed with 0c522fe42894), which moved the direncoding
from filelog into store
2012-09-15 21:44:08 +02:00
Adrian Buehlmann
574c96ecb1 store: remove uneeded startswith('data/') check in _hybridencode() 2012-09-15 21:43:56 +02:00
Adrian Buehlmann
5b06fb5a39 store: refactor splitting off of "data/" in _hybridencode()
encodefilename() already calls encodedir(). Note that encodedir() skips the
encoding if the path doesn't start with "data/".
2012-09-15 21:43:14 +02:00
Patrick Mezard
cad875fb81 Merge with stable 2012-09-17 21:53:50 +02:00
Tim Delaney
0872da322b hgweb: fix incorrect graph padding calculation (issue3626)
hgweb has an incorrect padding calculation, causing the text to move further
away from the graph the more branches there are (issue3626). This patch fixes
all existing templates (gitweb, monoblue, paper and spartan).

Tests updated by Patrick Mezard <patrick@mezard.eu>
2012-09-17 21:33:16 +02:00
Adrian Buehlmann
007324cd1e store: let _auxencode() return the list of path segments
so we can spare us splitting the path again in _hybridencode()
2012-09-15 21:43:05 +02:00
Adrian Buehlmann
95efee1bf9 store: eliminate unneded last assignment to n in _auxencode()
The check for period or space at the end of the string is the last one, the
local variable n is thus not used anymore.
2012-09-15 21:42:58 +02:00
Adrian Buehlmann
d900f301da store: unindent most of the contents of the for loop in _auxencode()
by refactoring

    for i, n in enumerate(res):
        if n:
            <main code block>

to

    for i, n in enumerate(res):
        if not n:
            continue
        <main code block>

(no functional change)
2012-09-15 21:42:52 +02:00
Adrian Buehlmann
77d1f7ae29 store: optimize _auxencode() by assigning to the list elements of the path 2012-09-15 21:42:43 +02:00
Adrian Buehlmann
c774df44ee store: optimze _auxencode() a bit by grouping the reserved names by length
This reduces perffncacheencode wall time on Windows 7 x64 for my netbeans clone
here from 4.3 to 4.0 (7% faster).
2012-09-15 21:41:09 +02:00
Adrian Buehlmann
8149bc6545 store: explain "aux.foo" versus "foo.aux" in doc of _auxencode() 2012-09-15 21:41:53 +02:00
Adrian Buehlmann
93e8048296 store: add 'com0' and 'lpt0' doctest cases for _auxencode()
These are already covered by test-hybridencode.py, but they are so noteworthy
that I think they deserve being shown right in that doctest.
2012-09-15 21:41:45 +02:00
Patrick Mezard
ed389c0023 wireproto: fix check-code.py breakage introduced by 6e0f31b6f59a 2012-09-15 08:38:02 +02:00
Bryan O'Sullivan
9c2cc273fb sshserver: avoid a multi-dot attribute lookup in a hot loop
This improves stream_out performance by about 3%.
2012-09-14 12:09:44 -07:00
Bryan O'Sullivan
b5119e949d store: reduce string concatenation when joining
This improves stream_out performance by a couple of percent.
2012-09-14 12:09:05 -07:00
Bryan O'Sullivan
1dc1178198 scmutil: use the new faster path split
Combined with a few other patches in this series, this contributes
to improving stream_out performance by 10%.
2012-09-14 12:08:55 -07:00
Bryan O'Sullivan
e3555667b8 util: implement a faster os.path.split for posix systems
This is not yet used.
2012-09-14 12:08:17 -07:00
Bryan O'Sullivan
7df4ae95dc scmutil: make join cheaper
Combined with a few followup patches, this contributes to improving
stream_out performance by 10%.
2012-09-14 12:07:33 -07:00
Bryan O'Sullivan
10380b320f wireproto: don't format a debug string inside a hot loop
This improves stream_out performance by about 5%.
2012-09-14 12:06:40 -07:00
Bryan O'Sullivan
55e3685d62 wireproto: bypass filechunkiter for small files when streaming
Merely creating and using a generator has a measurable impact,
particularly since the common case for stream_out is generators that
yield just once. Avoiding generators improves stream_out performance
by about 7%.
2012-09-14 12:05:37 -07:00
Bryan O'Sullivan
0b5b186a96 wireproto: don't audit local paths during stream_out
Auditing at this stage is both pointless (paths are already trusted by
the local repo) and expensive. Skipping the audits improves stream_out
performance by about 15%.
2012-09-14 12:05:12 -07:00
Bryan O'Sullivan
ecc7d720f1 scmutil: delegate mustaudit property to the real opener
This will be used by an upcoming patch.
2012-09-14 12:04:46 -07:00
Bryan O'Sullivan
51dda0ee74 scmutil: turn opener._audit into a property, mustaudit
This will be used by an upcoming patch.
2012-09-14 12:04:35 -07:00
Pierre-Yves David
ef39934b8c amend: preserve phase of amended revision (issue3602)
New commit from the amend process were created without any phase contraint. If
the amended changeset had a different phase from it's parent, the phases data
were lost.

The changeset ensure the new commit are created in the same phase than the
original changeset.
2012-08-30 16:47:08 +02:00
Takumi IINO
ba400386b5 help: fix literal block syntax 2012-09-07 00:42:42 +09:00
Bryan O'Sullivan
e9f644bcea Merge 2012-09-04 15:50:15 -07:00
Bryan O'Sullivan
bccd757a71 subrepo: encode unicode path names (issue3610)
Subversion 1.7 changes its XML output to include an explicit encoding tag:

  <?xml version="1.0" encoding="UTF-8"?>

This triggers xml.dom.minidom to always return unicode strings, causing
other parts of the code to explode.

We unconditionally encode path names before handing them back, which
works with both str (actually a no-op) and unicode values.
2012-09-04 15:46:04 -07:00
Bryan O'Sullivan
b30060d2aa Merge with stable 2012-09-04 13:49:39 -07:00
Mads Kiilerich
88105479b7 hgweb: avoid bad $$ processing in graph (issue3601)
JavaScript .replace always magically processed $$ $& $' $` in replacement
strings and thus displayed subject lines incorrectly in the graph view.

Instead of regexps and .replace we now just create the strings the right way in
the first place.
2012-08-29 02:09:43 +02:00
Steve Borho
029f4079a2 obsolete: import modules within mercurial/ without "from mercurial" 2012-08-28 11:15:34 -05:00
Pierre-Yves David
6431172ad3 bookmark: take successors into account when updating (issue3561)
When we rewrite a bookmarked changeset, we want to update the
bookmark on its successors. But the successors are not descendants
of its precursor (by definition). This changeset alters the bookmarks
logic to update bookmark location if the newer location is a successor
of the old one[1].

note: valid destinations are in fact any kind of successors of any kind
      of descendants (recursively.)

This changeset requires the enabling of the obsolete feature in
some bookmark tests.
2012-08-26 01:28:22 +02:00
Pierre-Yves David
342b88a402 bookmarks: extract valid destination logic in a dedicated function
We usually update bookmarks only if the new location is descendant of the old
bookmarks location.  We extract this logic into a function. This is the first
step to allow more complex logic using obsolescence in this validation of the
bookmark movement.
2012-08-26 00:28:56 +02:00
Pierre-Yves David
ad749501f8 checkheads: don't warn about unsynced changes that we ill obsolete
We won't be able to pull them after this push.
2012-08-26 00:27:44 +02:00
Pierre-Yves David
653c171718 checkheads: check successors for new heads in both missing and common
A relevant obsolete marker may have been added -after- we previously
exchanged the changeset. We have to search for remote heads that
disappear by the sole fact of pushing obsolescence.

This case will also happen when remote got the new version from a
repository that does not propagate obsolescence markers.
2012-08-26 00:25:33 +02:00
Pierre-Yves David
14699d4d9c checkheads: attend to phases when computing new heads with obsolete
Checkheads was more permissive than expected. When the remote heads
are public we don't need to search for successors. None will make a
public head disappear.
2012-08-24 16:52:45 +02:00
Bryan O'Sullivan
14c8cfede7 store: only one kind of OSError means "nonexistent entry" 2012-08-15 16:31:25 -07:00
Bryan O'Sullivan
d5c4b2870d store: sort the results of fncachestore.datafiles() 2012-08-15 16:30:32 -07:00
Sune Foldager
801d60844a rollback: write dirstate branch with correct encoding 2012-08-15 12:04:50 +02:00
Adrian Buehlmann
5b16379fd5 debuginstall: show directory for Python lib
Example new output

on Windows:

  $ hg debuginstall
  checking encoding (cp1252)...
  checking Python lib (C:\Users\adi\hgrepos\hg-main\hg-python\lib)...
  checking installed modules (C:\Users\adi\hgrepos\hg-main\mercurial)...
  checking templates (C:\Users\adi\hgrepos\hg-main\mercurial\templates)...
  checking commit editor...
  C:\Program Files (x86)\Notepad++\notepad++.exe
  checking username...
  no problems detected

on Linux:

  adi@kork-ubuntu64:~/hgrepos/hg-main$ ./hg debuginstall
  checking encoding (UTF-8)...
  checking Python lib (/usr/lib/python2.7)...
  checking installed modules (/home/adi/hgrepos/hg-main/mercurial)...
  checking templates (/home/adi/hgrepos/hg-main/mercurial/templates)...
  checking commit editor...
  checking username...
  no problems detected
2012-08-06 12:59:47 +02:00
Ross Lagerwall
661779d660 util: replace util.nulldev with os.devnull
Python since 2.4 has supported os.devnull so having util.nulldev
is unnecessary.
2012-08-04 07:14:40 +02:00
John Li
8400b38f0d merge: handle case when heads are all bookmarks
If all heads are bookmarks, merge fails to find what node to merge
with (throws an IndexError while indexing into the non-bookmark heads
list) as of 208ca72b9343. This catches that case and prints an error
to specify a rev explicitly.
2012-08-22 11:18:35 -04:00
Patrick Mezard
1e03a5cb1d verify: do not choke on valid changelog without manifest
Before this change:

  $ hg init
  $ hg branch foo
  $ hg ci -m branchfoo
  $ hg verify
  checking changesets
  checking manifests
   0: empty or missing manifest
  crosschecking files in changesets and manifests
  checking files
  0 files, 1 changesets, 0 total revisions
  1 integrity errors encountered!
  (first damaged changeset appears to be 0)
  [1]
2012-08-21 20:51:16 +02:00
Matt Mackall
b1f6dfb8ee merge heads in stable 2012-08-21 12:26:53 -05:00
Matt Mackall
30afcc9869 commit: normalize filenames when checking explicit files (issue3576) 2012-08-17 14:37:59 -05:00
Patrick Mezard
57f8b328dc fileset: fix generator vs list bug in fast path
$ hg debugfileset 'a or b'

would only return a or b but not both because the base file list was a
generator instead of a replayable sequence.
2012-08-15 22:50:23 +02:00
Patrick Mezard
04200aa71a debugfileset: implement --rev, more tests 2012-08-15 22:28:32 +02:00
Patrick Mezard
afc53271b1 fileset: do not traceback on invalid grep pattern 2012-08-15 19:25:45 +02:00
Patrick Mezard
5874c142ff fileset: matchctx.existing() must consider ignored files
When running:

  $ hg debugfileset 'binary() and ignored()'

getfileset() was correctly retrieving ignored files but
matchctx.existing() was not taking them in account. Just add them along
with unknown files.
2012-08-15 22:29:32 +02:00
Patrick Mezard
faab1846cc fileset: matchctx.existing() must consider unknown files
By default, unknown files are ignored. If the 'unknown()' predicate
appears in the syntax tree, then they are taken in account.
Unfortunately, matchctx.existing() was filtering against non-deleted
context files, which does not include unknown files. So:

  $ hg debugfileset 'binary() and unknown()'

would not return existing binary unknown files.
2012-08-15 22:29:09 +02:00
Patrick Mezard
663673858e fileset: exclude deleted files from matchctx.existing()
Running:

  $ hg debugfileset 'binary()'

would traceback if there were one deleted file in the working directory.
It happened because matchctx.existing() was filtering files against the
ctx.__contains__() but deleted files are still considered part of
workingctx.
2012-08-15 21:44:00 +02:00
Patrick Mezard
95df23a5ab fileset: actually implement 'minusset'
$ hg debugfileset 'a* - a1'

was tracing back because 'minus' symbol was not supported.
2012-08-15 19:02:04 +02:00
Pierre-Yves David
5b297fc1f8 strip: fix revset usage (issue3604)
The `repair` code builds a giant revset query instead of using the "%lr" idiom.
It is inefficient and crash when the number of stripped changeset is too big.

This changeset replaces the bad code by a better revset usage.
2012-08-31 23:27:26 +02:00
sorcerer
b04ae8ca03 revlog: don't try to partialmatch strings those length > 40
_partialmatch() does prefix matching against nodes. String passed
to _partialmetch() actualy may be any string, not prefix only.

For example,
"63af8381691a9e5c52ee57c4e965eb306f86826e or 300" is a good
argument for _partialmatch().

When _partialmatch() searches using radix tree, index_partialmatch()
C function shouldn't try to match too long strings.
2012-08-02 19:10:45 +04:00
Adrian Buehlmann
9a52491dad update: fix typo in help text
Spotted by Kevin Chase <kevincha99@hotmail.com>
2012-08-06 10:45:11 +02:00
Augie Fackler
5200764eb8 clone: don't fail with --update for non-local clones (issue3578)
This was broken by e01343f7da6f due to lack of test coverage. This
adds a test and fixes the defect.
2012-08-08 10:04:02 -05:00
Ross Lagerwall
48a670fcaf templater: handle a missing value correctly
Before, using a broken style such as:
changeset =
would result in a traceback.

This fixes a regression introduced in 47618355ffc8.
2012-08-04 14:37:17 +02:00
Javi Merino
7f1365342e help/hgweb: fix spelling error 2012-08-04 12:29:53 +02:00
Bryan O'Sullivan
dc9ede17dc Merge spelling fixes 2012-09-11 08:36:09 -07:00
Pierre-Yves David
e5780b8f05 amend: add obsolete support
If the obsolete feature is enabled, `hg commit --amend` marks a
changeset as obsolete instead of stripping it.
2012-09-11 00:12:07 +02:00
Pierre-Yves David
de8b13c1de obsolete: add a high level function to create an obsolete marker
This function is designed to be used by all code that creates new
obsolete markers in the local repository.

It is not used by debugobsolete because debugobsolete allows the
use of an unknown hash as argument.
2012-08-24 21:16:23 +02:00
Pierre-Yves David
6675d5b644 amend: use an explicit commit message for temporary amending commit
Before this changeset, the extra commit created during amend had
the same description as the final commit. This was a bit confusing
when trying to understand what that extra commit was about.

This changeset changes the description of such commit to:

    temporary amend commit for <ammend-commit-hash>

The old behaviour was not a big deal, but would become more confusing
once we use obsolescence marker instead of stripping the precursors.

This also helps if the user restores a strip backup.
2012-08-25 16:20:41 +02:00
Pierre-Yves David
d67eeabf85 amend: wrap all commit operations in a single transaction
This allows proper recovery of an interrupted amend process.
No changes are made to the logic besides:

- indent operations into a single try-except clause,
- some comment and code wrapping to 80 chars,
- strip logic should not be contained in the transaction and is extracted from
  the main code.
2012-09-10 23:44:24 +02:00
Pierre-Yves David
c2caef51a8 amend: lock the repository during the whole process
Without this changes another writer can lock the repository in the middle the
amend process. The resulting mess can be pretty ugly.
2012-08-25 15:37:28 +02:00
Bryan O'Sullivan
d51f61e8b8 Merge with crew 2012-09-10 14:08:10 -07:00
Patrick Mezard
f64e7c7ee8 Merge with stable 2012-09-09 12:35:06 +02:00
Pierre-Yves David
785d90eba0 obsolete: introduce caches for all meaningful sets
This changeset introduces caches on the `obsstore` that keeps track of sets of
revisions meaningful for obsolescence related logics. For now they are:

- obsolete: changesets used as precursors (and not public),
- extinct:  obsolete changesets with osbolete descendants only,
- unstable: non obsolete changesets with obsolete ancestors.

The cache is accessed using the `getobscache(repo, '<set-name>')` function which
builds the cache on demand. The `clearobscaches(repo)` function takes care of
clearing the caches if any.

Caches are cleared when one of these events happens:

- a new marker is added,
- a new changeset is added,
- some changesets are made public,
- some public changesets are demoted to draft or secret.

Declaration of more sets is made easy because we will have to handle at least
two other "troubles" (latecomer and conflicting).

Caches are now used by revset and changectx. It is usually not much more
expensive to compute the whole set than to check the property of a few elements.
The performance boost is welcome in case we apply obsolescence logic on a lot of
revisions. This makes the feature usable!
2012-08-28 20:52:04 +02:00
Ankur Dahiya
8c0a7c1aaf color: enabled color support for export command (issue1507)
The export command didn't output the diffs in color, even when color support
was enabled. This patch fixes that by making the export command use the default
ui.write method, instead of directly manipulating the ui.fout file object.
Also added a test case to verify color output to test-export.t.
2012-08-27 09:37:49 -07:00
Bryan O'Sullivan
a730557aab Merge with crew-stable 2012-09-06 10:57:49 -07:00
Yuya Nishihara
ee6b575238 hgweb: respond 403 forbidden for ssl required error
It's preferable to report "ssl required" as an error, so that the client
can detect error and exit with 255. Currently hg exits with 1, which is
"nothing to push."
2012-09-05 23:59:27 +09:00
timeless@mozdev.org
637d93ccce spelling: requested 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
bff9a96ea4 en-us: serialization 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
fbc4fce27b en-us: initialization 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
5ac26e3e56 grammar: it-handles 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
6edc2aa2a0 grammar: just-the-heads 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
e014ca03ca spelling: value 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
29317c8719 spelling: transferred 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
b770ee27e4 spelling: transaction 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
1ec7c319d2 spelling: thoroughly 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
6ed8f5a58d spelling: synchronize 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
36508e0e39 spelling: supersede 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
dbc876a6d7 spelling: successfully 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
2632fc55ea spelling: split 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
e3821d78cb spelling: specific 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
471deb0563 spelling: relies 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
9a22975e4d spelling: release 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
716780b3d0 spelling: recursion 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
6ef21e938c spelling: primarily 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
0d4e7dc2c2 spelling: prior 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
f659dfb743 spelling: precede 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
e67a2d2575 spelling: override 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
023e023a87 en-us: labeled 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
6c4d05a4f7 spelling: just 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
3aeec09cc5 spelling: journaling 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
0092ffa1fa spelling: indented
* * *
spelling: indented
2012-08-17 13:58:18 -07:00
timeless@mozdev.org
5cab7e44e1 spelling: further 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
2a84014df3 spelling: following 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
bba920f1b3 spelling: equivalent 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
326011a329 spelling: efficiently 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
a2941ed688 spelling: descendants 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
2a09dc2301 spelling: Explicitly 2012-08-17 13:58:18 -07:00
Adrian Buehlmann
0d13ec9185 manifest: remove redundant sorted() call for --all
repo.store.datafiles() is now already sorted (for all types of stores).

A follow-up to 9dc699058c9e.
2012-08-16 13:57:43 +02:00
Bryan O'Sullivan
44ed6ea941 Merge from crew-stable 2012-08-15 16:33:26 -07:00
Patrick Mezard
0f353320b5 Merge with stable 2012-08-15 23:03:40 +02:00
Sune Foldager
d0f83be327 merge with stable 2012-08-15 12:12:21 +02:00
Bryan O'Sullivan
d0fee76f96 Merge 2012-08-14 08:12:09 -07:00
Bryan O'Sullivan
4045197307 parsers: fix an integer size warning issued by clang 2012-08-13 14:04:52 -07:00
Bryan O'Sullivan
fa1f3c0da0 Merge with crew-stable 2012-09-04 15:50:42 -07:00
Benoit Boissinot
cbb9f61b3c merge with crew-stable 2012-08-31 23:42:02 +02:00
Pierre-Yves David
f74fef3b80 strip: fix revset usage (issue3604)
The `repair` code builds a giant revset query instead of using the "%lr" idiom.
It is inefficient and crash when the number of stripped changeset is too big.

This changeset replaces the bad code by a better revset usage.
2012-08-31 23:27:26 +02:00
Pierre-Yves David
76446449c3 test: remove invalid hidden rev in graphlog test
The hidden set of revision can not have descendant outside this set.

The extension is patched to raise and exception when this happen.
2012-08-30 22:13:24 +02:00
Patrick Mezard
191976de22 Merge with stable 2012-08-29 21:26:39 +02:00
Mads Kiilerich
ae09caa646 remove template-vars.txt - it is outdated and neither usable nor necessary 2012-08-29 01:24:57 +02:00
Mads Kiilerich
48016eb3fc declare local constants instead of using magic values and comments 2012-08-27 23:16:22 +02:00
Mads Kiilerich
5e3dc3e383 avoid using abbreviations that look like spelling errors 2012-08-27 23:14:27 +02:00
Mads Kiilerich
e973af65d0 improve some comments and docstrings, fixing issues found when spell checking 2012-08-21 02:41:20 +02:00
Mads Kiilerich
520076e707 delete some dead comments and docstrings 2012-08-21 02:41:20 +02:00
Mads Kiilerich
2372d51b68 fix wording and not-completely-trivial spelling errors and bad docstrings 2012-08-15 22:39:18 +02:00
Mads Kiilerich
2f4504e446 fix trivial spelling errors 2012-08-15 22:38:42 +02:00
Matt Mackall
ec8f1367b5 merge with stable 2012-08-28 17:59:08 -05:00
Matt Mackall
36c5db3d78 merge with stable 2012-08-24 17:51:47 -05:00
Patrick Mezard
7acf48f9a1 revset: add hidden() revset 2012-08-04 20:20:48 +02:00
Matt Mackall
04ee099a4c merge with stable 2012-08-24 14:53:07 -05:00
Bryan O'Sullivan
3234b8f8c6 Merge 2012-08-21 13:12:56 -07:00
Matt Mackall
fdc58e8172 merge with stable 2012-08-21 12:27:57 -05:00
Neil Kodner
68912667a4 templater: abort when a template filter raises an exception (issue2987) 2012-08-17 15:12:01 -07:00
Patrick Mezard
f5640dfc77 Merge with stable 2012-08-08 21:38:53 +02:00
Patrick Mezard
8474815dad Merge with stable 2012-08-04 15:58:23 +02:00
Patrick Mezard
dd04aa1b66 Merge with stable 2012-08-02 18:33:40 +02:00
Patrick Mezard
5d1bd7fadf context: simplify workingctx._parents 2012-08-02 17:48:58 +02:00
Idan Kamara
45c5c92f05 localrepo: clear the filecache on _rollback() and destroyed()
This restores the old behaviour of clearing the filecache when the repo is
destroyed but combines it with also clearing it on _rollback. Before, we tried
to only call it through _rollback but that ruined callers of destroyed.

Doing it on both code paths covers destroyed being called from somewhere
else, e.g. strip.
2012-07-28 22:40:30 +03:00
Mads Kiilerich
21e1a1a932 help: add 'mergetools' alias for the 'merge-tools' help topic
The '-' in 'merge-tools' is surprising but necessary in the configuration.
Let's help those who forget that and are looking for help.
2012-08-01 00:20:10 +02:00
Mads Kiilerich
4d30442bbe help: use the first topic name from helptable, not the longest alias
This makes the 'additional help topics' list consistent with the output from
keyword search (for instance subrepo/subrepos).

The sorting by longest name was introduced in 4cbe49492ad3. There might have
been a good reason for it back then, but now it seems like a better idea to
place the preferred name first in the list in helptable.
2012-08-01 14:59:15 +02:00
Mads Kiilerich
ae7b3c7a3b help: fix helptable indentation 2012-08-01 00:18:23 +02:00
Patrick Mezard
5ddea72e60 hgweb: fix graph view paging
- Fix off-by-one error on displayed entries count in normal mode
- Fix incorrect paging when the top revision was lower than revcount
- Fix revcount not overriding web.maxshortchanges everywhere
2012-07-29 23:16:20 +02:00
Patrick Mezard
460420407b help/config.txt: document web.maxshortchanges 2012-07-29 19:44:57 +02:00
Patrick Mezard
5839b36424 help/config.txt: reorder [web] options 2012-07-29 19:37:25 +02:00
Patrick Mezard
33ee7f119d log: make opts entries optional (issue2423) 2012-08-01 15:49:00 +02:00
Thomas Arendsen Hein
5fae640775 obsolete: fix typos in comments introduced by 2a0d51a9982b 2012-07-31 15:57:50 +02:00
Pierre-Yves David
0ae0504426 obsolete: properly increment currentlen when building pushkey payload
In the old code, the current length was always 0 leading to markers
payload never being split.
2012-07-31 15:32:08 +02:00
wujek srujek
5f5df03779 hgweb: fixes invalid parents / children in comparison
Previously, the parents / children were computed relative to the cset of the
currently shown file, which was wrong and inconsistent with diff and others.
With this patch, the listed csets are those that contain changes to the
currently compared file, which don't necessarily have to be the direct parents
and children of the changeset itself.
2012-07-31 00:59:38 +02:00
wujek srujek
7bcb15a47e hgweb: fixes traceback for invalid files by removing top-level template
The top-level 'comparison' template was not really needed, and it also caused a
traceback to be shown for inexistent files (as reported by Ross Lagerwall).
Getting rid of it makes the overall templating structure simpler and causes
invalid files to be handled nicely.
2012-07-31 14:14:15 +02:00
Mads Kiilerich
688b9e2048 check-code: indent 4 spaces in py files 2012-07-31 03:30:42 +02:00
Pierre-Yves David
fd393b84f3 pushkey: do not exchange obsole markers if feature is disabled
This apply to both push and pull both when client or server.
2012-07-28 13:33:06 +02:00
Pierre-Yves David
2b1b13bd1d obsolete: warns if markers exist in a repo where the feature is not enabled
We don't simply abort to allow the user to run other diagnostic commands.
2012-07-28 13:05:25 +02:00
Pierre-Yves David
6e161cf9e7 obsolete: introduce an _enabled switch to disable the feature by default
Obsolete markers wide-usage and propagation should be avoided by default until
the obsolete feature is more mature.

This changeset introduce the `_enable` variable and prevent the creation of
obsolete marker if the feature is set to `False` (the default).

More limitation comes in followup changesets.
2012-07-28 13:19:06 +02:00
Pierre-Yves David
dd7869713e pushkey: splits obsolete marker exchange into multiple keys
Obsolete markers are now exchanged in smaller pieces that fit in a http header.

This changes is done to avoid 400 bad request error when exchanging obsolete
puskey over http.

The last key pushed is always hold by the "dump0" key to ensure an easy place to
hook for people who need it.
2012-07-27 18:32:56 +02:00
Pierre-Yves David
44bf164af6 obsolete: add debug output regarding obsolete marker exchange. 2012-07-26 16:41:42 +02:00
Pierre-Yves David
a4bba98ab8 pushkey: add more verbose debug output regarding pushkey
Very few data are displayed now, making it hard to debug phases and obsolete
related issues.
2012-07-28 12:28:35 +02:00
Patrick Mezard
1701c358d5 debugobsolete: do not traceback on invalid node identifiers 2012-07-30 19:26:05 +02:00
Patrick Mezard
b5860803d6 revset: minor doc fixes on obsolete related revsets 2012-07-30 15:48:04 +02:00
Ross Lagerwall
7137940459 hgweb: make paper:error consistent with template
Tests fixed by Patrick Mézard <patrick@mezard.eu>
2012-07-30 11:33:27 +02:00
Ross Lagerwall
efa6c8abd3 hgweb: avoid traceback when file or node parameters are missing
Previously, browsing to http://serv/diff would generate an internal
server error due to the file and node parameters being missing.
The same error also occurred for filelog, comparison and annotate.
2012-07-30 11:02:10 +02:00
Ross Lagerwall
7ec5d4f25c hgweb: fix "branches" links in gitweb template
Tests fixed by Patrick Mézard <patrick@mezard.eu>
2012-07-30 08:18:25 +02:00
Ross Lagerwall
ff4e211aec hgweb: fix typo in monoblue template 2012-07-30 08:11:22 +02:00
Ross Lagerwall
264ebcb826 hgweb: fix capitalization in monoblue template
Make the capitalization consistent on all pages.
2012-07-30 08:06:05 +02:00
Matt Mackall
b4fc0b7eac hgweb: avoid traceback if raw is used as default style
Spotted by Angel Ezquerra.
2012-07-29 11:08:45 -05:00
Simon Heimberg
8a8e06a51f peer: delete double definition of method peer 2012-07-28 22:36:22 +02:00
FUJIWARA Katsunori
b4636b9d05 revset: fix the definition of "unstable changesets" for "unstable" predicate
unstable-ness of changesets should be determined by obsolete-ness of
not descendants but ancestors.
2012-07-28 23:51:57 +09:00
FUJIWARA Katsunori
0cf97588a4 doc: unify section level between help topics
Some help topics use "-" for the top level underlining section mark,
but "-" is used also for the top level categorization in generated
documents: "hg.1.html", for example.

So, TOC in such documents contain "sections in each topics", too.

This patch changes underlining section mark in some help topics to
unify section level in generated documents.

After this patching, levels of each section marks are:

  level0
  """"""
    level1
    ======
      level2
      ------
        level3
        ......
          level4
          ######

And use of section markers in each documents are:

  - mercurial/help/*.txt can use level1 or more
    (now these use level1 and level2)

  - help for core commands can use level2 or more
    (now these use no section marker)

  - descriptions of extensions can use level2 or more
    (now hgext/acl uses level2)

  - help for commands defined in extension can use level4 or more
    (now "convert" of hgext/convert uses level4)

"Level0" is used as top level categorization only in "doc/hg.1.txt"
and the intermediate file generated by "doc/gendoc.py", so end users
don't see it in "hg help" outoput and so on.
2012-07-25 16:40:38 +09:00
Patrick Mezard
64822182ac addremove: mention --similarity defaults to 100 (issue3430) 2012-07-23 19:03:32 +02:00
Greg Ward
9468b4b81c revset: polish explanation of the difference between file() and filelog() 2012-07-25 22:41:26 -04:00
Augie Fackler
d7b1ad91f4 strip: move bookmarks to nearest ancestor rather than '.'
If you've got this graph:

0-1-2
   \
    3

and 3 is checked out, 2 is bookmarked with "broken", and you do "hg
strip 2", the bookmark will move to 3, not 1. That's always struck me
as a bug.

This change makes bookmarks move to the tipmost ancestor of
the stripped set rather than the currently-checked-out revision, which
is what I always expected should happen.
2012-07-26 16:57:50 -05:00
Matt Mackall
9eb6c76d12 merge with crew 2012-07-27 12:32:02 -05:00
Patrick Mezard
00c80f6fa8 webcommands: do not modify repo.tagslist()
Repeatedly refreshing a gitweb summary page served by hg serve would
show the tags list switching between two different sequences.
2012-07-27 17:48:49 +02:00
Patrick Mezard
2e04c51661 identity: show trailing '+' for dirty subrepos (issue2839) 2012-07-27 13:56:19 +02:00
Patrick Mezard
a34c356944 discovery: fix invalid comment about extinct being ignored 2012-07-27 10:16:20 +02:00
Pierre-Yves David
35a54a30a2 obsolete: fix decoding error message arguments 2012-07-26 16:21:43 +02:00
Patrick Mezard
f40d444448 push: do not try to push remote obsolete if local has none 2012-07-24 21:20:56 +02:00
Mads Kiilerich
377db36818 help: fix some instances of 'the the' 2012-07-26 02:54:13 +02:00
Matt Mackall
3d4a489c40 merge with crew 2012-07-18 19:08:11 -05:00
Martin Geisler
c1e716912d merge with stable 2012-07-19 00:54:33 +02:00