Commit Graph

16650 Commits

Author SHA1 Message Date
Matt Mackall
42c30757a2 revlog: don't handle long for revision matching
The underlying C code doesn't support indexing by longs, there are no
legitimate reasons to use a long, and longs should generally be
converted to ints at a higher level by context's constructor.
2012-05-21 16:36:09 -05:00
Matt Mackall
d53510c6a2 merge with stable 2012-05-21 16:35:27 -05:00
Matt Mackall
ca006af287 context: grudging accept longs in constructor 2012-05-21 16:32:50 -05:00
Matt Mackall
c082b3d973 win32: fix encoding handling for registry strings (issue3467)
This stopped handling non-ASCII strings in 1.8
2012-05-21 16:32:49 -05:00
Adrian Buehlmann
3a26ebacab mpatch: use Py_ssize_t for string length 2012-05-20 01:28:31 +02:00
Adrian Buehlmann
96bc6f8416 mpatch: use Py_ssize_t
Eliminates

  mpatch.c(73) : warning C4244: 'return' : conversion from '__int64' to 'int',
  possible loss of data
  mpatch.c(299) : warning C4244: 'function' : conversion from 'Py_ssize_t' to
  'int', possible loss of data
  mpatch.c(321) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int',
  possible loss of data
  mpatch.c(335) : warning C4244: 'function' : conversion from 'Py_ssize_t' to
  'int', possible loss of data
  mpatch.c(346) : warning C4244: 'function' : conversion from 'Py_ssize_t' to
  'int', possible loss of data

when compiling for Windows x64 target using the Microsoft compiler.
2012-05-20 00:08:18 +02:00
Dov Feldstern
bc4eac4b26 subrepo: make subrepo.subrepo(<not a subrepo path>) fail
Until now, when calling subrepo.subrepo with a path at which there is no
subrepo, a "nullstate" tuple would be returned. However, this is not very
useful (the tuple can't really be used for creating a subrepo), so we'd just as
soon have the function just fail, and leave it up to the caller to decide what
to do.

The motivation for doing this now is to simplify the solution for (issue3056).
2012-05-20 21:11:34 +03:00
Matt Mackall
e0b2cc783f merge with stable 2012-05-20 14:40:36 -05:00
Matt Mackall
764c110123 hgweb: use ui.nontty to disable all cooked I/O 2012-05-20 14:37:22 -05:00
Matt Mackall
d9056446c0 progress: use ui._isatty 2012-05-20 14:37:20 -05:00
Matt Mackall
99486917d1 pager: use ui._isatty infrastructure 2012-05-20 14:33:49 -05:00
Matt Mackall
b267442ddb ui: add _isatty method to easily disable cooked I/O 2012-05-20 14:31:56 -05:00
FUJIWARA Katsunori
db8047a1c0 doc: add detail explanation for 'present()' predicate of revsets 2012-05-16 17:02:30 +09:00
Matt Mackall
1af38adeb7 osutil: handle deletion race with readdir/stat (issue3463) 2012-05-18 14:34:33 -05:00
Matt Mackall
4bd5c2d220 merge with i18n 2012-05-17 12:15:30 -05:00
Adrian Buehlmann
e54da6574b bdiff: check and cast first parameter value on putbe32() calls
Eliminates

  mercurial/bdiff.c(383) : warning C4244: 'function' : conversion from '__int64'
  to 'uint32_t', possible loss of data
  mercurial/bdiff.c(384) : warning C4244: 'function' : conversion from '__int64'
  to 'uint32_t', possible loss of data
  mercurial/bdiff.c(385) : warning C4244: 'function' : conversion from
  'Py_ssize_t' to 'uint32_t', possible loss of data

when compiling for Windows x64 target using the Microsoft compiler.
2012-05-15 22:36:47 +02:00
Adrian Buehlmann
933c7c3ffa bdiff: use Py_ssize_t instead of int
Reduces the conversion warnings

  mercurial/bdiff.c(61) : warning C4244: '=' : conversion from '__int64' to
  'int', possible loss of data
  mercurial/bdiff.c(307) : warning C4244: 'function' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/bdiff.c(308) : warning C4244: 'function' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/bdiff.c(362) : warning C4244: '+=' : conversion from '__int64' to
  'int', possible loss of data
  mercurial/bdiff.c(380) : warning C4244: '=' : conversion from '__int64' to
  'int', possible loss of data
  mercurial/bdiff.c(381) : warning C4244: 'function' : conversion from '__int64'
  to 'uint32_t', possible loss of data
  mercurial/bdiff.c(382) : warning C4244: 'function' : conversion from '__int64'
  to 'uint32_t', possible loss of data
  mercurial/bdiff.c(416) : warning C4244: '=' : conversion from 'Py_ssize_t' to
  'int', possible loss of data

to

  mercurial/bdiff.c(383) : warning C4244: 'function' : conversion from '__int64'
  to 'uint32_t', possible loss of data
  mercurial/bdiff.c(384) : warning C4244: 'function' : conversion from '__int64'
  to 'uint32_t', possible loss of data
  mercurial/bdiff.c(385) : warning C4244: 'function' : conversion from
  'Py_ssize_t' to 'uint32_t', possible loss of data

on the three putbe32() calls in the function bdiff

when compiling for Windows x64 target using the Microsoft compiler.
2012-05-15 22:36:27 +02:00
Matt Mackall
67c0680caa merge with stable 2012-05-17 15:52:14 -05:00
Matt Mackall
7e8d9b6e6f branchcache: backout 29529231e17d 2012-05-17 15:34:59 -05:00
Augie Fackler
1d813c0d7e dispatch: try and identify third-party extensions as sources of tracebacks
Extension authors should explicitly declare their supported hg
versions and include a buglink attribute in their extension. In the
event that a traceback occurs, we'll identify the
least-recently-tested extensionas the most likely source of the defect
and suggest the user disable that extension.

Packagers should make every effort to ship hg versions from exact
tags, or with as few modifications as possible so that the versioning
can work appropriately.
2012-05-16 16:18:07 -05:00
Augie Fackler
96d44b39f7 hgext: mark all first-party extensions as such 2012-05-15 14:37:49 -05:00
Alexander Sauta
4b12c54fc2 i18n-ru: synchronized with 88b33d9639ed 2012-05-15 14:58:16 +01:00
Sune Foldager
aea3159eaa bundle: make bundles more portable (isue3441)
This is achieved by acting as if the user had given -r<rev> for each head rev
of outgoing changesets on the command line, as well as appropriate
--base <rev>.

The discovery information is computed as normal, and then adjusted as above.
2012-05-12 19:38:20 +02:00
Matt Harbison
353d5deeb2 revset: fix traceback for bogus revisions in id(rev)
hg log -r "id(1234567)" now returns an empty list like rev() does.
2012-05-14 19:25:13 -04:00
Thomas Arendsen Hein
6dc228e4f6 Makefile: remove generated mercurial/__version__.py 2012-05-15 12:44:07 +02:00
Mark Round
7b5857715d posix: workaround lack of TIOCGWINSZ on Irix (issue3449)
On an Irix 6.5.24 system, TIOCGWINSZ is not available. This means that
any usage of the "hg" tool that looks up the terminal size (e.g. "hg
help") will fail with an AttributeError.

A simple work-around is just to wrap this block in mercurial/posix.py
with a try/except so that it ends up using the default 80 characters
width.
2012-05-14 13:25:42 +01:00
Matt Mackall
dbfb64e582 hgweb: fix filediff base calculation
Previously, we were finding the most recent version of a file in a
changeset and comparing it against its first file parent. This was
wrong on three counts:

- it would show a diff in revisions where there was no change to a file
- it would show a diff when only the exec bit changed
- it would potentially compare against a much older changeset, which
  could be very expensive if git-style rename detection was enabled

This compares the file in the current context with that context's
parent, which may result in an empty diff when looking at a file not
touched by the current changeset.
2012-05-14 12:56:43 +02:00
Mads Kiilerich
b315fbc5ab largefiles: use wlock for lfconvert (issue3444)
largefiles and lfconvert do dirty hacks with dirstate, so to avoid writing that
as a side effect of the wlock release we clear dirstate first.

To avoid confusing lock validation algorithms in error situations we unlock
_before_ removing the target directory.
2012-05-13 17:34:55 +02:00
Matt Mackall
732d9d463a merge with i18n 2012-05-13 11:19:48 +02:00
Wagner Bruna
a0f8506b26 i18n-pt_BR: synchronized with 636975388817 2012-05-08 15:31:14 -03:00
Patrick Mezard
742f6b3850 pure/base85: align exception type/msg on base85.c
brendan mentioned on IRC that b64decode raises a TypeError too, but while the
previous exception type may be better in general, it is much easier to make it
behave like the related C code and changes nothing for mercurial itself.
2012-05-07 21:49:45 +02:00
Matt Mackall
d8dfd80d76 parsers: fix refcount bug on corrupt index
When we encounter a corrupt index, we "fail" the init but our
destructor still gets called. On some systems, this was causing us to
attempt to decref a dangling to self->data.
2012-05-07 15:40:50 -05:00
Kevin Bullock
a4f03c7e07 bookmarks: test that bare update forwards active bookmark 2012-05-05 15:12:26 -05:00
Christian Ebert
7b42c28269 keyword: intentionally ignore check-code warning about unwrapped ui message 2012-05-13 14:26:26 +01:00
Kevin Bullock
b4041f99fa help: include bookmarks in 'help revisions' and simplify wording 2012-05-16 10:29:11 -05: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
Bryan O'Sullivan
226bc14024 parsers: use Py_CLEAR where appropriate 2012-05-13 11:56:50 +02:00
Na'Tosha Bard
b035ee4c71 largefiles: fix addremove when largefile is missing (issue3227) 2012-05-13 12:11:50 +02:00
Bryan O'Sullivan
b0afd19075 tags: short-circuit if no tags have ever been committed 2012-05-13 12:01:52 +02:00
Matt Mackall
082c081b22 largefiles: fix default clone destination regression 2012-05-16 11:40:33 -05:00
Matt Mackall
52baed62da merge with crew 2012-05-15 07:01:35 +02:00
Matt Mackall
264c1fb976 merge with stable 2012-05-15 07:00:55 +02:00
Levi Bard
c5f81ed918 largefiles: don't attempt to clone all largefiles to non-local destinations 2012-05-13 22:59:22 +02:00
Brodie Rao
74e79a93a2 branches: improve performance by removing redundant operations
This refactors the branches command so it collects all the information it needs
about a branch in one pass over the branch map.

In particular, it fixes an issue where the command called repo.branchtags() to
get branch tips, and then used repo.branchheads() to get the closed/open
status. Both repo methods read the changelog to determine if the branch is
closed, resulting in extra, redundant I/O.

For the PyPy repo with 744 branches and 843 branch heads, this brings
hg branches over NFS from:

   CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
        2427            0      0.9057      0.9057   <open>
        2424            0      0.4096      0.4096   <method 'close' of 'file' objects>
        2424            0      0.0476      0.0476   <method 'read' of 'file' objects>
           1            0      0.0468      0.0468   mercurial.revlog:637(headrevs)
          +1            0      0.0000      0.0000   +<len>
        2422            0      0.0443      0.0443   <method 'seek' of 'file' objects>
        2962            0      0.0337      0.0337   <zlib.decompress>
        2491            0      1.8008      0.0322   mercurial.changelog:182(read)
       +2491            0      1.6982      0.0315   +mercurial.revlog:881(revision)
       +2488            0      0.0269      0.0134   +mercurial.changelog:28(decodeextra)
       +4982            0      0.0085      0.0085   +<method 'split' of 'str' objects>
       +4982            0      0.0274      0.0049   +mercurial.encoding:61(tolocal)
       +2491            0      0.0039      0.0039   +<method 'index' of 'str' objects>
        2491            0      1.6982      0.0315   mercurial.revlog:881(revision)
       +2413            0      0.0112      0.0112   +mercurial.revlog:305(rev)
       +2491            0      1.5315      0.0068   +mercurial.revlog:847(_chunkraw)
       +2491            0      0.0414      0.0058   +mercurial.revlog:945(_checkhash)
       +2491            0      0.0028      0.0028   +mercurial.revlog:349(flags)
       +2491            0      0.0025      0.0025   +<mercurial.mpatch.patches>
        2422            0      1.5089      0.0286   mercurial.revlog:818(_loadchunk)
       +2422            0      0.4093      0.4093   +<method 'close' of 'file' objects>
       +2422            0      0.0451      0.0451   +<method 'read' of 'file' objects>
       +2422            0      0.0443      0.0443   +<method 'seek' of 'file' objects>
       +2422            0      0.9703      0.0096   +mercurial.store:374(__call__)
       +2422            0      0.0079      0.0069   +mercurial.revlog:810(_addchunk)
        5804            0      0.0204      0.0204   mercurial.revlog:305(rev)
        2426            0      0.9552      0.0177   mercurial.scmutil:218(__call__)
       +2426            0      0.9057      0.9057   +<open>
       +2426            0      0.0120      0.0083   +os.path:80(split)
       +2426            0      0.0061      0.0049   +mercurial.scmutil:92(__call__)
Time: real 1.950 secs (user 0.560+0.000 sys 0.220+0.000)

down to:

   CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
        1545            0      0.6035      0.6035   <open>
        1542            0      0.2697      0.2697   <method 'close' of 'file' objects>
           1            0      0.0547      0.0547   mercurial.revlog:637(headrevs)
          +1            0      0.0000      0.0000   +<len>
        1542            0      0.0389      0.0389   <method 'read' of 'file' objects>
        1540            0      0.0316      0.0316   <method 'seek' of 'file' objects>
        1853            0      0.0227      0.0227   <zlib.decompress>
        1557            0      1.2131      0.0226   mercurial.changelog:182(read)
       +1557            0      1.1398      0.0221   +mercurial.revlog:881(revision)
       +1555            0      0.0199      0.0094   +mercurial.changelog:28(decodeextra)
       +3114            0      0.0058      0.0058   +<method 'split' of 'str' objects>
       +3114            0      0.0196      0.0035   +mercurial.encoding:61(tolocal)
       +1557            0      0.0026      0.0026   +<method 'index' of 'str' objects>
        1557            0      1.1398      0.0221   mercurial.revlog:881(revision)
       +1557            0      1.0307      0.0047   +mercurial.revlog:847(_chunkraw)
       +1557            0      0.0287      0.0040   +mercurial.revlog:945(_checkhash)
       +1557            0      0.0018      0.0018   +<mercurial.mpatch.patches>
       +1557            0      0.0018      0.0018   +mercurial.revlog:326(node)
       +1557            0      0.0417      0.0013   +mercurial.revlog:857(_chunkbase)
        1540            0      1.0147      0.0210   mercurial.revlog:818(_loadchunk)
       +1540            0      0.2693      0.2693   +<method 'close' of 'file' objects>
       +1540            0      0.0360      0.0360   +<method 'read' of 'file' objects>
       +1540            0      0.0316      0.0316   +<method 'seek' of 'file' objects>
       +1540            0      0.6487      0.0070   +mercurial.store:374(__call__)
       +1540            0      0.0059      0.0052   +mercurial.revlog:810(_addchunk)
        3192            0      0.0173      0.0173   mercurial.revlog:305(rev)
        8184            0      0.0300      0.0147   <method 'decode' of 'str' objects>
       +5204            0      0.0149      0.0048   +encodings.utf_8:15(decode)
          +1            0      0.0004      0.0000   +encodings:71(search_function)
          43           26      0.0147      0.0129   <__import__>
Time: real 1.390 secs (user 0.450+0.000 sys 0.170+0.000)
2012-05-13 14:04:07 +02:00
Brodie Rao
ab32f1721d context: add changectx.closesbranch() method
This removes the duplicated code for inspecting the 'close' extra field in
a changeset.
2012-05-13 14:04:06 +02:00
Brodie Rao
d36ae7f264 localrepo: add branchtip() method for faster single-branch lookups
For the PyPy repo with 744 branches and 843 branch heads, this brings
hg log -r default over NFS from:

   CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
        3249            0      1.3222      1.3222   <open>
        3244            0      0.6211      0.6211   <method 'close' of 'file' objects>
        3243            0      0.0800      0.0800   <method 'read' of 'file' objects>
        3241            0      0.0660      0.0660   <method 'seek' of 'file' objects>
        3905            0      0.0476      0.0476   <zlib.decompress>
        3281            0      2.6756      0.0472   mercurial.changelog:182(read)
       +3281            0      2.5256      0.0453   +mercurial.revlog:881(revision)
       +3276            0      0.0389      0.0196   +mercurial.changelog:28(decodeextra)
       +6562            0      0.0123      0.0123   +<method 'split' of 'str' objects>
       +6562            0      0.0408      0.0073   +mercurial.encoding:61(tolocal)
       +3281            0      0.0054      0.0054   +<method 'index' of 'str' objects>
        3241            0      2.2464      0.0456   mercurial.revlog:818(_loadchunk)
       +3241            0      0.6205      0.6205   +<method 'close' of 'file' objects>
       +3241            0      0.0765      0.0765   +<method 'read' of 'file' objects>
       +3241            0      0.0660      0.0660   +<method 'seek' of 'file' objects>
       +3241            0      1.4209      0.0135   +mercurial.store:374(__call__)
       +3241            0      0.0122      0.0107   +mercurial.revlog:810(_addchunk)
        3281            0      2.5256      0.0453   mercurial.revlog:881(revision)
       +3280            0      0.0175      0.0175   +mercurial.revlog:305(rev)
       +3281            0      2.2819      0.0119   +mercurial.revlog:847(_chunkraw)
       +3281            0      0.0603      0.0083   +mercurial.revlog:945(_checkhash)
       +3281            0      0.0051      0.0051   +mercurial.revlog:349(flags)
       +3281            0      0.0040      0.0040   +<mercurial.mpatch.patches>
       13682            0      0.0479      0.0248   <method 'decode' of 'str' objects>
       +7418            0      0.0228      0.0076   +encodings.utf_8:15(decode)
          +1            0      0.0003      0.0000   +encodings:71(search_function)
        3248            0      1.3995      0.0246   mercurial.scmutil:218(__call__)
       +3248            0      1.3222      1.3222   +<open>
       +3248            0      0.0235      0.0184   +os.path:80(split)
       +3248            0      0.0084      0.0068   +mercurial.scmutil:92(__call__)
Time: real 2.750 secs (user 0.680+0.000 sys 0.360+0.000)

down to:

   CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
          55           31      0.0197      0.0163   <__import__>
          +1            0      0.0006      0.0002   +mercurial.context:8(<module>)
          +1            0      0.0042      0.0001   +mercurial.revlog:12(<module>)
          +1            0      0.0002      0.0001   +mercurial.match:8(<module>)
          +1            0      0.0003      0.0001   +mercurial.dirstate:7(<module>)
          +1            0      0.0057      0.0001   +mercurial.changelog:8(<module>)
           1            0      0.0117      0.0032   mercurial.localrepo:525(_readbranchcache)
        +844            0      0.0015      0.0015   +<binascii.unhexlify>
        +845            0      0.0010      0.0010   +<method 'split' of 'str' objects>
        +843            0      0.0045      0.0009   +mercurial.encoding:61(tolocal)
        +843            0      0.0004      0.0004   +<method 'setdefault' of 'dict' objects>
          +1            0      0.0003      0.0003   +<method 'close' of 'file' objects>
           3            0      0.0029      0.0029   <method 'read' of 'file' objects>
           9            0      0.0018      0.0018   <open>
         990            0      0.0017      0.0017   <binascii.unhexlify>
          53            0      0.0016      0.0016   mercurial.demandimport:43(__init__)
         862            0      0.0015      0.0015   <_codecs.utf_8_decode>
         862            0      0.0037      0.0014   <method 'decode' of 'str' objects>
        +862            0      0.0023      0.0008   +encodings.utf_8:15(decode)
         981            0      0.0011      0.0011   <method 'split' of 'str' objects>
         861            0      0.0046      0.0009   mercurial.encoding:61(tolocal)
        +861            0      0.0037      0.0014   +<method 'decode' of 'str' objects>
         862            0      0.0023      0.0008   encodings.utf_8:15(decode)
        +862            0      0.0015      0.0015   +<_codecs.utf_8_decode>
           4            0      0.0008      0.0008   <method 'close' of 'file' objects>
         179          154      0.0202      0.0004   mercurial.demandimport:83(__getattribute__)
         +36           11      0.0199      0.0003   +mercurial.demandimport:55(_load)
         +72            0      0.0001      0.0001   +mercurial.demandimport:83(__getattribute__)
         +36            0      0.0000      0.0000   +<getattr>
           1            0      0.0015      0.0004   mercurial.tags:148(_readtagcache)
Time: real 0.060 secs (user 0.030+0.000 sys 0.010+0.000)
2012-05-13 14:04:04 +02:00
David Soria Parra
f8942bb230 strip: introduce -B option to remove a bookmark
Add a -B option to remove a bookmark. All revisions are unreachable
from a different head or a different bookmark will be removed too.

This helps with topic branch workflow. You can create a topic branch
and remove it if not needed anymore with hg strip -B topic/xyz.
2012-05-13 16:39:40 +02:00
Martin Geisler
e0d9047429 phases: wrap docstrings at 70 characters 2012-05-13 12:07:49 +02:00
Martin Geisler
79a3fc20d2 phases: fix typos in docstrings 2012-05-13 12:06:12 +02:00
Patrick Mezard
de32ec835b test-rebase-collapse: fix Windows path separator 2012-05-13 14:29:05 +02:00