Commit Graph

16700 Commits

Author SHA1 Message Date
Olav Reinert
70c42374e2 minirst: generate tables as a list of joined lines 2012-06-01 11:58:23 +02:00
Christian Ebert
840a657147 keyword: update copyleft 2012-05-26 20:49:51 +02:00
Christian Ebert
932da89b94 keyword: wlock cmdutil.copy wrapper
Expanding/shrinking happens outside the wrapped copy function;
therefore write lock the repo.
2012-05-26 20:49:44 +02:00
Christian Ebert
06fe63f255 keyword: support commit --amend (issue3471)
Include a test as well.
2012-05-26 20:46:12 +02:00
Christian Ebert
0ce6a128c9 keyword: rename kwt.record attribute to kwt.postcommit
A more general descriptive name, as the attribute will be used
for commit --amend as well.
2012-05-25 19:32:29 +02:00
Adrian Buehlmann
19b92fcf59 scmutil: use _winreg.HKEY_LOCAL_MACHINE 2012-05-27 11:30:03 +02:00
Adrian Buehlmann
9ecfd4a916 win32: move lookupreg() to windows.py
lookupreg() doesn't use the win32 API directly any more, it uses the Python
standard library module _winreg.
2012-05-27 11:29:52 +02:00
Adrian Buehlmann
dae9e15d0a win32: use Python's _winreg again
This is a partial backout of 7efea3b5db4c.

7efea3b5db4c switched win32.py to using ctypes with the intention to get rid
of the dependency on the pywin32 package.

But 7efea3b5db4c replaced the usage of the Python standard module _winreg in
lookup_reg as well, which was uneeded (note that lookup_reg was later renamed
into lookupreg).

Basically, we're switching back to the previous _winreg-based implementation,
which uses _winreg.QueryValueEx(). QueryValueEx returns a unicode code string.

See also: issue3467
2012-05-27 11:29:45 +02:00
Bryan O'Sullivan
509438662e lsprof: report units correctly 2012-05-30 13:57:41 -07:00
Bryan O'Sullivan
bef5b61512 cleanup: use the deque type where appropriate
There have been quite a few places where we pop elements off the
front of a list.  This can turn O(n) algorithms into something more
like O(n**2).  Python has provided a deque type that can do this
efficiently since at least 2.4.

As an example of the difference a deque can make, it improves
perfancestors performance on a Linux repo from 0.50 seconds to 0.36.
2012-05-15 10:46:23 -07:00
Bryan O'Sullivan
45a54a6b08 perf: add a perfancestors benchmark 2012-05-15 10:44:17 -07:00
Matt Mackall
662b1241be merge with stable 2012-05-30 14:31:51 -05:00
Matt Mackall
b49b66c0f2 merge with crew 2012-05-30 14:31:39 -05:00
Matt Mackall
2d85685b68 merge with i18n 2012-05-30 14:31:29 -05:00
Matt Mackall
bfe92722a0 merge with stable 2012-05-30 14:21:58 -05:00
Matt Mackall
d4e4a5b5be revpair: handle odd ranges (issue3474) 2012-05-30 14:13:57 -05:00
FUJIWARA Katsunori
53d7bfd5d8 i18n-ja: synchronized with 878641b4f1d3 2012-05-29 21:32:50 +09:00
Alexander Sauta
785c6458c0 i1n-ru:synchronized with 0ee6800b3663 2012-05-27 15:37:36 +01:00
Wagner Bruna
fadad79d3f i18n-pt_BR: synchronized with 8381a52c9211 2012-05-27 09:52:25 -03:00
Thomas Arendsen Hein
6c60809dcc merge: show renamed on one and deleted on the other side in debug output 2012-05-23 21:34:29 +02:00
Thomas Arendsen Hein
91a8201c52 merge: warn about file deleted in one branch and renamed in other (issue3074)
For divergent renames the following message is printed during merge:
note: possible conflict - file was renamed multiple times to:
 newfile
 file2

When a file is renamed in one branch and deleted in the other, the file still
exists after a merge. With this change a similar message is printed for mv+rm:

note: possible conflict - file was deleted and renamed to:
 newfile
2012-05-23 20:50:16 +02:00
Thomas Arendsen Hein
d79df9bd09 tests: do not create repos inside repos in test-rename-merge1.t
This is no actual problem, but I when adding more tests to this file,
the directory structure would become t/repo2089/repoXXXX/repoYYYY/...
2012-05-23 17:33:19 +02:00
Thomas Arendsen Hein
4735ff24c9 merge: do not warn about copy and rename in the same transaction (issue2113) 2012-05-23 17:25:48 +02:00
Matt Mackall
8c3c80ff37 merge with stable 2012-05-22 14:37:20 -05:00
FUJIWARA Katsunori
abfb6c35d4 match: make 'match.files()' return list object always
'exact' match objects are sometimes created with a non-list 'pattern'
argument:

  - using 'set' in queue.refresh():hgext/mq.py
        match = scmutil.matchfiles(repo, set(c[0] + c[1] + c[2] + inclsubs))

  - using 'dict' in revert():mercurial/cmdutil.py (names = {})
        m = scmutil.matchfiles(repo, names)

'exact' match objects return specified 'pattern' to callers of
'match.files()' as it is, so it is a non-list object.

but almost all implementations expect 'match.files()' to return a list
object, so this may causes problems: e.g. exception for "+" with
another list object.

this patch ensures that '_files' of 'exact' match objects is a list
object.

for non 'exact' match objects, parsing specified 'pattern' already
ensures that it it a list one.
2012-05-23 00:25:29 +09:00
Patrick Mezard
139c15da66 revset: fix infinite alias expansion detection
The alias expansion code it changed from:
1- Get replacement tree
2- Substitute arguments in the replacement tree
3- Expand the replacement tree again

into:

1- Get the replacement tree
2- Expand the replacement tree
3- Expand the arguments
4- Substitute the expanded arguments in the replacement tree

and fixes cases like:

  [revsetalias]
  level1($1, $2) = $1 or $2
  level2($1, $2) = level1($2, $1)

  $ hg log -r "level2(level1(1, 2), 3)"

where the original version incorrectly aborted on infinite expansion
error, because it was confusing the expanded aliases with their
arguments.
2012-05-19 17:19:55 +02:00
Patrick Mezard
c7a80dee31 revset: explicitely tag alias arguments for expansion
The current revset alias expansion code works like:
1- Get the replacement tree
2- Substitute the variables in the replacement tree
3- Expand the replacement tree

It makes it easy to substitute alias arguments because the placeholders
are always replaced before the updated replacement tree is expanded
again. Unfortunately, to fix other alias expansion issues, we need to
reorder the sequence and delay the argument substitution. To solve this,
a new "virtual" construct called _aliasarg() is introduced and injected
when parsing the aliases definitions. Only _aliasarg() will be
substituted in the argument expansion phase instead of all regular
matching string. We also check user inputs do not contain unexpected
_aliasarg() instances to avoid argument injections.
2012-05-19 17:18:29 +02:00
Augie Fackler
3dc5160169 util: fix bad variable use in bytecount introduced by ad5e3bec298e 2012-05-21 14:24:24 -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
Bryan O'Sullivan
7ddd8678d8 perf: add a perfdirstatewrite benchmark 2012-05-16 13:45:46 -07:00
Bryan O'Sullivan
1e9deb3b01 parsers: cache the result of index_headrevs
Although index_headrevs is much faster than its Python counterpart,
it's still somewhat expensive when history is large. Since headrevs
is called several times when the tag cache is stale or missing (e.g.
after a strip or rebase), there's a win to be gained from caching
the result, which we do here.
2012-05-19 20:21:48 -07:00
Bryan O'Sullivan
a49ea963d7 revlog: switch to a C version of headrevs
The C implementation is more than 100 times faster than the Python
version (which is still available as a fallback).

In a repo with 330,000 revs and a stale .hg/cache/tags file, this
patch improves the performance of "hg tip" from 2.2 to 1.6 seconds.
2012-05-19 19:44:58 -07:00
Bryan O'Sullivan
18476b4834 perf: rework perfheads and perftags to clear caches
The cache clearing makes numbers more reproducible.
2012-05-19 19:44:23 -07:00
Bryan O'Sullivan
f9c29929d4 parsers: reduce raw_length when truncating
When stripping revs, we now update raw_length to correctly reflect
the new end of the index.
2012-05-19 19:44:18 -07:00
Olav Reinert
39ea6b3464 help: inline helper function used once only 2012-05-22 22:08:41 +02:00
Olav Reinert
a1155c64ad help: remove redundant parameter 2012-05-22 22:08:41 +02:00
Olav Reinert
b372d3da28 help: move some helper functions to help.py 2012-05-22 22:08:41 +02:00
Olav Reinert
2dabd3c23f help: remove dependency on ui from some helper functions 2012-05-22 22:08:41 +02:00
David Schleimer
fc014ab773 hg-ssh: refactor to have main() method
Refactor hg-ssh to have a main() function instead of a bunch of
top-level statements.
2012-05-21 16:19:30 -07: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
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