Commit Graph

9332 Commits

Author SHA1 Message Date
Thomas Arendsen Hein
b722606b41 merge with crew-stable 2012-10-04 16:44:28 +02:00
Thomas Arendsen Hein
8ffc4bf2ff merge with crew-stable 2012-10-04 10:11:17 +02:00
Bryan O'Sullivan
950dd7a0b6 Merge 2012-10-02 14:31:14 -07:00
Bryan O'Sullivan
e6925c17ab keepalive: drop python 2.2 legacy code 2012-10-02 14:27:13 -07:00
Matt Mackall
f53af524d3 hgweb: change IE canvas test (issue3639)
suggested by Peter Hull
2012-10-01 23:05:02 -05:00
Adrian Buehlmann
14553ab848 store: optimize _pathencode by checking the length of the unencoded path
If the input path is already longer than _maxstorepathlen, then we can skip
doing the basic encoding (encodedir, _encodefname and _auxencode) and directly
proceed to the hashed encoding. Those encodings, if at all, will make the path
only longer.
2012-09-30 23:53:56 +02:00
Adrian Buehlmann
5de7aaf8a4 pathencode: skip encoding if input is already longer than maxstorepathlen
Calling basicencode may make the path longer, never shorter. If it's already
too long before, then we don't even need to basicencode it.
2012-09-30 23:53:56 +02:00
Adrian Buehlmann
377fe9eee4 pathencode: simplify basicencode 2012-09-30 23:53:56 +02:00
Patrick Mezard
acaf80ffc0 Merge 2012-10-01 21:54:04 +02:00
David Soria Parra
2a3cae29ea bookmarks: teach the -r option to use revsets 2012-10-01 03:19:23 +02:00
André Sintzoff
54640fd383 pathencode: change isset name to avoid name collision
On old Mac OS X versions (10.4), arpa/inet.h (included in mercurial/util.h)
includes system/param.h which defines isset macro.
2012-09-30 15:31:27 +02:00
Juan Pablo Carbajal (desktop)
653db536f4 help: add example of paths other than default in hgrc 2012-09-29 13:41:02 +02:00
Juan Pablo Carbajal (desktop)
e5fed625df help: removing trailing spaces 2012-09-29 13:34:37 +02:00
Matt Mackall
721e01ea74 merge with stable 2012-09-29 12:28:52 -05:00
Matt Mackall
3a2547f38e scmutil: backout ea219479a44b (issue3643) 2012-09-29 11:57:16 -05:00
Pierre-Yves David
7fb7b9e016 clfilter: introduce filteredrevs attribute on changelog
This changeset allows changelog object to be "filtered". You can assign a set of
revision numbers to the `changelog.filteredrevs` attributes. The changelog will
then pretends these revision does not exists in this repo.

A few methods need to be altered to achieve this behavior:

- tip
- __iter_
- irevs
- hasnode
- headrevs

For consistency and to help debugging, the following methods are altered too.
Tests tend to show it's not necessary to alter them but have them raise proper
exception helps to detect bad acces to filtered revisions.

- rev
- node
- linkrev
- parentrevs
- flags

The following methods would also need alteration for consistency purpose but
this is non-trivial and not done yet.

- nodemap
- strip

The C version of headrevs is not run if there is any revision to filter. It'll
need a proper rewrite later to restore performance.
2012-09-20 19:02:47 +02:00
Pierre-Yves David
6a88d239df clfilter: remove any explicit revision number from default cmdutil range
Revision "0" and "-1" may be filtered, we can't use them in any default
revrange.
2012-09-03 14:29:05 +02:00
Pierre-Yves David
df82aab75f clfilter: remove usage of range in favor of iteration over changelog
If we want to apply filtering at changelog level, we need to iterate over it.
See previous changeset description for details.
2012-09-20 19:01:53 +02:00
Pierre-Yves David
6d6a3d27a5 clfilter: split revlog.headrevs C call from python code
Make the pure python implementation of headrevs available to derived classes. It
is important because filtering logic applied by `revlog` derived class won't
have effect on `index`. We want to be able to bypass this C call to implement
our own.
2012-09-03 14:19:45 +02:00
Pierre-Yves David
23fb63d637 clfilter: handle non contiguous iteration in revlov.headrevs
This prepares changelog level filtering.  We can't assume that any revision can
be heads because filtered revisions need to be excluded.

New algorithm:
- All revisions now start as "non heads",
- every revision we iterate over is made candidate head,
- parents of iterated revisions are definitely not head.

Filtered revisions are never iterated over and never considered as candidate
head.
2012-09-03 14:12:45 +02:00
Pierre-Yves David
6981326b92 clfilter: make the revlog class responsible of all its iteration
This prepares changelog level filtering. We need the algorithms used in revlog to
work on a subset of revisions.  To achieve this, the use of explicit range of
revision is banned. `range` and `xrange` calls are replaced by a `revlog.irevs`
method. Filtered super class can then overwrite the `irevs` method to filter out
revision.
2012-09-20 19:00:59 +02:00
Pierre-Yves David
5ae3830b30 clfilter: introduce a hassecret function
We can only use copy clone if the cloned repo do not have any secret changeset.
The current method for that is to run the "secret()" revset on the remote repo.
But with proper filtering of hidden or unserved revision by the remote this
revset won't return any revision even if some exist remotely. This changeset
adds an explicit function to know if a repo have any secret revision or not.

The other option would be to disable filtering for the query but I prefer the
approach above, lighter both regarding code and performance.
2012-09-03 14:05:19 +02:00
Pierre-Yves David
2b76effa06 filter: updatebranchcache during addchangegroup instead of after lock
The forced recomputation of the branch cache was introduced by `b4909adfc093`.
Back there, `addchangegroup` did not handle any lock logic.

Later `6042c410e045` introduced lock logic to `addchangegroup`. Its description
does not explain why the `updatebranchcache` call is made outside locking. I
believe that the lock was released there because it fit well with the transaction
release already in the code.

Finally `1eda82d76f0c` moved all "unlocked" code of `addchangegroup` to an
`repo._afterlock` callback.

I do not think that the call to `updatebranchcache()` requires to be done
outside locking. That may even be a bad idea to do so. Bringing this call back
in the `addchangegroup` function makes the flow simpler and eases the following
up changelog level filtering business.
2012-09-03 14:03:38 +02:00
Sergey Kishchenko
bdc9eebe77 resolve: commit the changes after each item resolve (issue3638)
At the moment the resolve command doesn't save progress during the resolve process. In example if you try to resolve 100 conflicting files and interrupt the process (e.g., you close the external merge tool) after resolving 50 files you'll end up with 100 unresolved conflicts. Saving the progress helps a lot with long going merges. It's easy to achieve same behavior with simple script that calls resolve command for each unresolved file but it makes sense to make such behavior a default
2012-09-25 20:50:40 +03:00
FUJIWARA Katsunori
3bef78e26e bookmarks: rename arguments/variables for source code readability
Before this patch, the argument bound to the source repository of
incoming bookmarks for "bookmarks.diff()" is named as "remote".

But in "hg outgoing" case, this argument is bound to local repository
object.

In addition to it, "local"/"remote" seem to mean not the direction of
propagation of bookmarks, but just the location of cooperative
repositories.

To indicate the direction of propagation of bookmarks clearly on the
source code, this patch uses "d(st)" and "s(rc)" combination instead
of "l(ocal)" and "r(emote)" one.

  - "repo" and "remote" arguments are renamed to "dst" and "src"
  - "lmarks" and "rmarks" variables are renamed to "dmarsk" and "smarks"
2012-09-22 14:53:50 +09:00
FUJIWARA Katsunori
3562bbd4bf localrepo: use "vfs" constructor/field for initialization around "store" 2012-08-31 02:06:29 +09:00
FUJIWARA Katsunori
405ef27bab store: initialize "vfs" fields by "vfs" constructors
For backwards compatibility, "opener" fields are still left as aliases
for "vfs" ones.
2012-08-31 02:06:29 +09:00
FUJIWARA Katsunori
076ab3b9e8 store: rename "op" variables to "vfs" 2012-08-31 02:06:29 +09:00
FUJIWARA Katsunori
afccfdd4e0 store: rename "openertype" argument to "vfstype" 2012-08-31 02:06:29 +09:00
FUJIWARA Katsunori
c303a9b344 localrepo: use "vfs" constructor instead of "opener" one
This patch also changes initialization order of "*opener" and "*vfs"
fields: first, "*vfs" fields are initialized , and then, "*opener"
ones are initialized.
2012-08-31 02:06:29 +09:00
FUJIWARA Katsunori
97278fdfa7 scmutil: rename classes from "opener" to "vfs"
For backwards compatibility, aliases for the old names are added,
except for "abstractopener", "statichttpopener" and "_fncacheopener",
because these are not used in Mercurial core implementation after this
patch.

"_fncacheopener" was only referred in "fncachestore" constructor, so
this patch also renames from "_fncacheopener" to "_fncachevfs" there.
2012-08-31 02:06:29 +09:00
Matt Mackall
14f92efff9 templatefilters: add parameterized date method 2012-09-24 15:54:45 -05:00
Matt Mackall
3289404a04 templatefilters: add parameterized fill function 2012-09-24 15:54:44 -05:00
Matt Mackall
d55a703a7d templater: pull in functions defined in templatefilters 2012-09-24 15:28:04 -05:00
Matt Mackall
e32befe1a7 templater: add if/ifeq conditionals 2012-09-24 15:26:56 -05:00
Matt Mackall
0aa788b5f2 templater: add sub() function 2012-09-24 15:26:17 -05:00
Matt Mackall
07ad449236 templater: correctly deal with r"" strings 2012-09-24 15:24:27 -05:00
Matt Mackall
01ed21300f template: add join function
This allows:

{join(files % "{files}", ", ") }\n

to produce a properly comma-separated list
2012-09-22 13:04:36 -05:00
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