Commit Graph

9238 Commits

Author SHA1 Message Date
Bryan O'Sullivan
2f5fcdb4f3 Merge 2012-10-08 09:55:41 -07:00
Idan Kamara
4d2c787f1d fancyopts: don't show a traceback on invalid integer values 2012-10-08 15:35:16 +02:00
Thomas Arendsen Hein
024d25472d subrepo, hghave: use "svn --version --quiet" to determine version number
svn --version --quiet is implemented since svn 0.14.1 (August 2002)
and prints just the version number, not the long output (21 lines)
of "svn --version".

Additionally I expect this output format to be more stable, at least
it is not changed with different translations.
2012-10-04 16:52:20 +02:00
Thomas Arendsen Hein
b722606b41 merge with crew-stable 2012-10-04 16:44:28 +02:00
Thomas Arendsen Hein
42db02b2a5 subrepo: setting LC_MESSAGES only works if LC_ALL is empty or unset
For example LC_ALL=de_DE.utf-8 would cause the version check to fail,
because "svn, Version 1.6.12 (r955767)" with a capital "V" will be printed.
Using "svn --version --quiet" would only print the version number, but then
matching other messages, e.g. "Committed revision" would fail.
2012-10-04 16:30:40 +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
Thomas Arendsen Hein
b144254849 clone: activate bookmark specified with --updaterev 2012-10-02 09:26:42 +02: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
Tomasz Kleczek
7063833db6 lock: fixed race condition in trylock/testlock (issue3506)
Suppose the following scenario:

1. Process A takes the lock (e.g. on commit).
2. Process B wants to grab the lock. Since lock file exists
   the exception is raised. In the catch block the testlock
   function is called.
3. Process A releases the lock.
4. Process B tries to read the lock file as a part of testlock
   function. This results in OSError (ENOENT) and since we're
   not inside the exception handler function this is propagated
   and aborts the whole operation.

To fix this we now check in testlock function whether lock file
actually exists and if not (i.e. if readlock fails) we just return.
2012-09-27 14:38:03 -07: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