Commit Graph

1235 Commits

Author SHA1 Message Date
Bryan O'Sullivan
b5a37656e8 contrib: add a commit synthesizer for reproducing scaling problems
This adds two new commands:

- analyze examines an existing repo and writes out a statistical
  description of its properties that contains no identifying
  information.

- synthesize creates new commits based on the description generated
  by analyze.

The intention is that a repo constructed using synthesize will have
properties that are vaguely statistically similar to the originating
repo, but entirely random content.

This can be useful for forecasting performance as a repo grows, and
for developers who want to find bottlenecks in proprietary repos
to which they do not have access.
2012-10-08 15:57:21 -07:00
Idan Kamara
4922480923 check-code: replace heredocs in unified tests
Heredocs are usually fed to other commands and
shouldn't follow the standard conventions of shell
commands.

This restores the old behaviour of how heredocs
were handled in old-style test files.
2012-10-03 22:09:18 +02:00
Augie Fackler
322c35ca0e lock-checker: new contrib extension based on work done by Mads
This makes it possible to do lock validation as part of a normal test
run. I didn't attempt any wlock validation because that's a bit more
subtle to detect properly. Thanks to the initial patch from Mads for
the idea.
2012-08-01 22:13:27 -05:00
Thomas Arendsen Hein
23c6bfee41 check-code: catch yield inside try/finally (with tests)
This is not allowed in Python 2.4.
2012-09-19 12:29:12 +02:00
Adrian Buehlmann
4c2547f734 perf: add perffncacheencode
Examples (all done with somewhat dated clones I found on my disk):

Netbeans (~120k entries in fncache):

  $ hg perffncacheencode
  ! wall 4.338000 comb 4.336828 user 4.336828 sys 0.000000 (best of 3)

Openoffice (~77k entries in fncache)):

  $ hg perffncacheencode
  ! wall 1.533000 comb 1.528810 user 1.528810 sys 0.000000 (best of 7)

Xen (~10k entries in fncache):

  $ hg perffncacheencode
  ! wall 0.198000 comb 0.187201 user 0.187201 sys 0.000000 (best of 51)

Done on Windows 7 x64.
2012-09-14 13:02:31 +02:00
Bryan O'Sullivan
dc9ede17dc Merge spelling fixes 2012-09-11 08:36:09 -07:00
Kevin Bullock
8b9c78e8cb bash_completion: add rebase rev completion 2012-08-31 13:17:16 -05:00
timeless@mozdev.org
001844931f en-us: penalize 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
7d38ae466d spelling: syntactic 2012-08-17 13:58:19 -07:00
timeless@mozdev.org
886e3f77f4 spelling: implementing 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
e1f80f8f4e spelling: existence 2012-08-17 13:58:18 -07:00
Benoit Boissinot
cbb9f61b3c merge with crew-stable 2012-08-31 23:42:02 +02:00
Patrick Mezard
191976de22 Merge with stable 2012-08-29 21:26:39 +02:00
Steve Borho
985c4254c1 wix: pick up new template files 2012-08-29 13:16:56 -05: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
5e3dc3e383 avoid using abbreviations that look like spelling errors 2012-08-27 23:14:27 +02:00
Mads Kiilerich
2f4504e446 fix trivial spelling errors 2012-08-15 22:38:42 +02:00
Nikolaj Sjujskij
b9344b4e7f zsh completion: tweak options for incoming, outgoing and rebase
* `incoming --rev` completes _hg_labels, not jsut tags;
 * `outgoing --rev` completes revrange;
 * source/dest/base for `rebase` require argument.
2012-08-16 19:04:27 +04:00
Nikolaj Sjujskij
040cab71af zsh completion: update mq commands completion
* add qclone command;
 * qapplied/qunapplied: add --last/--first;
 * qdiff: add all diff options;
 * qfold: add --force, --no-backup;
 * qgoto: add --keep-changes;
 * qimport: add --git, --push;
 * qnew: add user- and date-related options;
 * qpop/qpush: add --keep-changes and --no-backup, drop --name;
 * qpush: drop deprecated --merge;
 * qrename: complete only unapplied patches' names;
 * strip: add --rev, --keep, --bookmark, update descriptions, drop --backup.
2012-08-16 19:03:01 +04:00
Nikolaj Sjujskij
a3205da673 zsh completion: add new options for existing commands
* backout: add --tool;
 * bisect: add --extend;
 * bookmarks: add --inactive;
 * branches: add --closed;
 * bundle: add --rev, --all, --branch;
 * cat: add --decode;
 * clone: add --updaterev, --branch, --pull and use common-with-qclone opts;
 * commit: add --close-branch;
 * diff: add --change, --reverse, --stat, --text, --unified;
 * export: add --rev;
 * grep: add --date;
 * heads: add --topo, --closed;
 * help: add --extension, --command, --keywords; complete additional help
   topics also, not commands only;
 * identify: add --bookmark and remote_opts;
 * import: add --no-commit, --exact, --import-branch, --date, --user,
   --similarity and commit options;
 * log: add --user, --date, --stat, --git, --graph;
 * manifest: add --rev;
 * push: add --new-branch;
 * resolve: add --all, --no-status, --tool and pattern options;
 * revert: add --date;
 * serve: add --prefix, --web-conf, --pid-file, --cmdserver, --certificate;
 * status: add --change;
 * tag: add --force, --edit, --remove;
 * tip: add --git;
 * update: add --check, --date.
2012-08-16 19:03:01 +04:00
Nikolaj Sjujskij
6443deebc9 zsh completion: add support for convert, graphlog, purge, record extensions 2012-08-16 19:03:01 +04:00
Nikolaj Sjujskij
beb65b038d zsh completion: add subrepos options for all supporting commands 2012-08-16 19:03:01 +04:00
Nikolaj Sjujskij
937e4dd5ea zsh completion: add new option groups for options
Add clone, date/user, git-style, merge tool, ignore space, log,
branch/bookmarks options and use them throughout command completions.
2012-08-16 19:03:01 +04:00
Nikolaj Sjujskij
501c8fe2e3 zsh completion: add forget and rollback commands 2012-08-16 19:02:49 +04:00
Nikolaj Sjujskij
d1e6c4fb90 zsh completion: complete additional topics for help, not commands only 2012-08-16 11:21:46 +04:00
Matt Mackall
36c5db3d78 merge with stable 2012-08-24 17:51:47 -05:00
Steve Borho
6ec99fd6af wix: bump MSI based installers to use Python 2.7
We're somewhat forced to use Python 2.7 for the bdist packages, so we might
as well use 2.7 for the MSI installers as well.
2012-08-23 18:19:19 -05:00
Pierre-Yves David
da8e5d78a1 mergetools.hgrc: set vimdiff to check=changed
The standard reaction in from of unexpected vimdiff is to ":quit". This will
make vimdiff return a 0 status even if no merge were done at all.

This change detect that nothing have been changed in vimdiff as a potential
unresolved conflict.
2012-08-02 13:51:49 +02:00
Mads Kiilerich
688b9e2048 check-code: indent 4 spaces in py files 2012-07-31 03:30:42 +02:00
Pascal Quantin
4b07220f53 win32: update Inno Setup installer extensions list 2012-07-29 17:04:51 +02:00
Mads Kiilerich
59664fd950 check-code: fix check for trailing whitespace on continued lines too
The tests in test-annotate.t and test-import-git.t that relied on trailing
space in a file created by a here string is now masked by a literal 'EOL'
string that is removed.
2012-08-08 18:10:37 +02:00
Mads Kiilerich
cdcad9a14c check-code: fix check for trailing whitespace on empty lines
It seems like the intention with c4ecbbd282fe was to catch lines with only
one whitespace too.
2012-08-08 18:10:30 +02:00
Mads Kiilerich
9cddfd19ab check-code: fix check for trailing whitespace on sh command lines
The $ has been without necessary escaping since introduced in c4ecbbd282fe.
2012-08-08 18:10:16 +02:00
Mads Kiilerich
377db36818 help: fix some instances of 'the the' 2012-07-26 02:54:13 +02:00
Joshua Redstone
2118475aca perf: fix perfcca to work with new casecollisionauditor interface
A recent changeset, 66b3a64f7b5e, modified the caescollisionauditor interface
but did not update perf.py.  This changeset remidies that.
2012-07-18 07:51:20 -07:00
Pierre-Yves David
6bb5e54b11 check-code: recognise %= as an operator 2012-07-06 19:48:19 +02:00
Mads Kiilerich
2108c6e927 check-code: verify that 'saved backup bundle to ...' is '(glob)'ed
This is the most frequent trivial reason tests fail on Windows.
2012-07-05 00:49:26 +02:00
Nikolaj Sjujskij
a8c3df9635 zsh completion: catch up with 2.2 commands and options
* add completion for phase and graft core commands
 * add completion for rebase extension
 * add new options for already defined commands:
   * commit --amend
   * import --bypass
   * manifest --all
   * merge --tool
   * revert -C (short for --no-backup)
   * qpush --exact [mq]
   * email --body [patchbomb]
2012-06-20 17:40:19 +04:00
Mads Kiilerich
a4be6ed644 test-alias: adapt for Windows
The test used 'echo' to test '!' style aliases. On Windows 'echo' is handled
by cmd and thus behaves very differently from the 'normal' echo command.

The simple workaround used here for using the same alias on all platforms
is to use 'printf' instead. Msys 'printf' will also handle sh quoting and
escaping in cmd.

Environment variable expansion with sh syntax is handled by launching sh.
2012-06-16 21:57:42 +02:00
Bryan O'Sullivan
6ba97b40c1 revlog: ancestors(*revs) becomes ancestors(revs) (API)
Accepting a variable number of arguments as the old API did is
deeply ugly, particularly as it means the API can't be extended
with new arguments.  Partly as a result, we have at least three
different implementations of the same ancestors algorithm (!?).

Most callers were forced to call ancestors(*somelist), adding to
both inefficiency and ugliness.
2012-06-01 12:37:18 -07:00
Bryan O'Sullivan
167441c211 perf: add a benchmark for revrange 2012-06-01 15:50:22 -07:00
David Schleimer
499f4df5a8 hg-ssh: read-only flag
Allows you to restrict a ssh key to have read-only access to a set of
repos by passing the --read-only flag to hg-ssh.

This is useful in an environment where the number of unix users you
can or are willing to create is limited.  In such an environment,
multiple users or applications will share a single unix account.  Some
of those applications will likely need read-only access to the
repository.  This change makes it possible to grant them such access
without requiring that they use a separate unix account.
2012-05-22 15:17:37 -07:00
Bryan O'Sullivan
45a54a6b08 perf: add a perfancestors benchmark 2012-05-15 10:44:17 -07:00
Bryan O'Sullivan
7ddd8678d8 perf: add a perfdirstatewrite benchmark 2012-05-16 13:45:46 -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
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
Brodie Rao
7f47d4e347 check-code: ignore naked excepts with a "re-raise" comment
This also promotes the naked except check from a warning to an error.
2012-05-13 13:18:06 +02:00
Brodie Rao
391c9b5bf1 check-code: improve detection of naked except clauses 2012-05-13 13:17:50 +02:00
Brodie Rao
47a3ca1c2f check-code: promote 80+ character line warning to an error 2012-05-13 13:17:27 +02:00
Brodie Rao
a706d64a2c cleanup: replace naked excepts with except Exception: ... 2012-05-12 16:02:46 +02:00
Brodie Rao
c577fac135 cleanup: replace naked excepts with more specific ones 2012-05-12 16:02:45 +02:00
Brodie Rao
92158e04de cleanup: "raise SomeException()" -> "raise SomeException" 2012-05-12 16:00:58 +02:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
Mads Kiilerich
80eee013e1 tests: unify the last sh tests
This requires a slightly smarter check-code check for sed output filtering.
2012-04-25 01:35:39 +02:00
Mads Kiilerich
f4efda66d8 tests: run most check-code sh checks on continued lines too
Some false errors are degraded to warnings and whitelisted.
2012-04-25 01:35:39 +02:00
Matt Mackall
6d78ec67ed merge with stable 2012-05-11 14:48:24 +02:00
Mads Kiilerich
99a4f5f5b9 hg-ssh: exit with 255 instead of -1 on error
Unix sh would cast -1 to 255 anyway, but on windows -1 become 0. Better be
explicit with the 255 everywhere.
2012-05-07 00:52:08 +02:00
Mads Kiilerich
91529dce53 hg-ssh: use %s for printing paths in error messages
This avoids \\ if this ever is run on windows - for example in the test suite.
2012-05-07 00:49:01 +02:00
Martin Geisler
24e4bf05a3 check-code: catch unnecessary s.strip().split() calls 2012-05-07 10:02:50 +02:00
Steven Stallion
d36350c9a1 plan9: mkfile and 9diff fixes
This patch deals with an unnecessary backslash in 9diff and improper
quoting in the contrib mkfile.
2012-04-28 23:01:31 -07:00
Martin Geisler
bde13df69f doc: update copyright years to 2012
I sometimes look at a piece of software and if the man page says
"Copyright 2004", then I'm inclined to think that the project is stale
or that the authors are lazy. Neither is good publicity for us :-)
2012-04-30 12:04:30 +02:00
Mads Kiilerich
b7e85cefa1 tests: avoid tab indent on all kinds of lines of sh commands 2012-04-23 01:56:48 +02:00
Mads Kiilerich
f64bae7ea3 tests: use 'do sleep 0' instead of 'do true', also on first line of command
2cd44a791e66 established that '... do true ...' shouldn't be used, but that was
only enforced on continued lines.
2012-04-23 01:56:48 +02:00
Mads Kiilerich
ca99a3d167 check-code: put grouping around regexps generated from testpats
This removes the pitfall that would make the testpath r'a|b' match 'b' on all
lines in .t tests.
2012-04-23 01:56:48 +02:00
Mads Kiilerich
b1160b7ec5 tests: don't use /dev/urandom for largefiles testing
There is no need to use entropy here just to create some content that only will
be used for hashing and ignored.

This avoids a problem where dd from /dev/urandom on solaris generates too short
output.
2012-04-23 01:56:48 +02:00
Steven Stallion
1a611af55b plan9: add missing source entries to proto 2012-04-21 08:24:10 -07:00
Mads Kiilerich
4c1897dde5 tests: fix incorrect markup of continued lines of sh commands 2012-04-23 01:39:26 +02:00
Mads Kiilerich
9f4ca6b4df check-code: 'printf \0' is apparently fine - accept it in check-code
Nobody complained over '\0' in test-eol.t.

The too strict check becomes a problem when this check is applied to more
lines.
2012-04-23 01:39:26 +02:00
Mads Kiilerich
e5bed4bfb4 tests: solaris sh can not negate exit status with '!' 2012-04-23 01:39:26 +02:00
Mads Kiilerich
d63ff4f9a5 tests: ^ must be quoted when used on solaris sh
The check was broken when it was introduced in 8924361c0202.
2012-04-23 01:39:26 +02:00
Steven Stallion
3ad03bc654 plan9: finalize documentation for next release 2012-04-15 23:47:46 -07:00
Matt Mackall
4ca25d50f9 merge with stable 2012-04-14 01:39:35 -05:00
Patrick Mezard
bdf6ede885 mq: replace hasattr() with util.safehasattr(), update check-code.py 2012-04-13 15:07:13 +02:00
Bryan O'Sullivan
dc46676e81 parsers: use base-16 trie for faster node->rev mapping
This greatly speeds up node->rev lookups, with results that are
often user-perceptible: for instance, "hg --time log" of the node
associated with rev 1000 on a linux-2.6 repo improves from 0.3
seconds to 0.03.  I have not found any instances of slowdowns.

The new perfnodelookup command in contrib/perf.py demonstrates the
speedup more dramatically, since it performs no I/O.  For a single
lookup, the new code is about 40x faster.

These changes also prepare the ground for the possibility of further
improving the performance of prefix-based node lookups.
2012-04-12 14:05:59 -07:00
Matt Mackall
05bbeed32b check-code: avoid false-positive on ++ 2012-04-12 20:22:18 -05:00
Bryan O'Sullivan
22e70490ba perf: time fncache read and write performance 2012-04-12 15:21:52 -07:00
Jim Hague
77587a4c7a tests: avoid test-hup hanging on AIX
test-hup hangs on AIX. Under ksh89 on AIX (the default shell),

echo Hello; while [ ! -s not-there ]; do true; done

produces no output while the loop executes. Replacing 'true' with 'sleep 0'
fixes, as does using a less broken shell. ksh93 is fine.

Update check-code.py to look for this, and make same change in test-serve.t.
In fact test-serve works fine, probably because of additional commands between
echo and the loop, but that's a subtlety not easy to test for.
2012-04-05 12:31:21 +01:00
Steven Stallion
8076654c92 plan9: add execute permissions to 9diff 2012-04-10 23:40:20 -07:00
Matt Mackall
ebe322955c perf: add case collision auditor perf 2012-04-10 12:07:16 -05:00
Steven Stallion
d79ff306e5 plan9: initial support for plan 9 from bell labs
This patch contains support for Plan 9 from Bell Labs. A README is
provided in contrib/plan9 which describes the port in greater detail.
A new extension is also provided named factotum which permits the
factotum(4) authentication agent to provide credentials for HTTP
repositories. This extension is also applicable to other POSIX
platforms which make use of Plan 9 from User Space (aka plan9ports).
2012-04-08 12:43:41 -07:00
Matt Mackall
560dd93d34 merge with stable 2012-04-06 15:18:14 -05:00
Matt Mackall
4325ad525f tests: remove sed -i from test-record 2012-04-01 13:59:11 -05:00
Augie Fackler
dfc3978483 zsh completion: fix error in qfinish completions from 584f7a076523
The actual flag is --applied, not --all.
2012-03-31 15:39:44 -05:00
Matt Mackall
98ed4dc5e9 perf: node lookup 2012-03-30 14:16:06 -05:00
Greg Ward
66a1ddf402 shrink-revlog: make check-code happier
There's still a naked 'except:' clause, but I'm not sure how to fix it
(what exception is it expecting?). This just fixes line length.
2012-03-28 15:25:20 -04:00
Greg Ward
05fadec600 shrink-revlog: make pyflakes happy 2012-03-28 15:15:15 -04:00
Matt Mackall
c13dd2e166 perf: add a changeset test 2012-03-16 19:58:47 -05:00
Matt Mackall
cf0424ed5e perf: add perfchangeset to time changeset parsing 2012-03-15 15:58:55 -05:00
Matt Mackall
7fbdc6a514 perf: tweak tests for testing index performance improvements 2012-03-15 13:11:03 -05:00
Matt Mackall
87d3671dbf merge with stable 2012-03-12 17:05:42 -05:00
Thomas Arendsen Hein
2210a784fd extdiff: escape filenames with vim/DirDiff and make quoting work with Windows
Use vim function fnameescape() on filenames.
Use double quotes for arguments so cmd.exe is happy.
2012-03-12 09:39:30 +01:00
Matt Mackall
cc8b3a2b01 pvec: introduce pvecs 2012-03-12 13:37:39 -05:00
Steve Borho
9fbec5585f wix: add phases help text and two more translations (issue 3288) 2012-03-03 23:14:31 -06:00
Matt Mackall
bd04c54a71 check-code: check for % inside _() 2012-03-08 15:59:44 -06:00
Jim Hague
78a686772b tests: tighten checks for octal escapes in shell printf.
printf on AIX default shell ksh (89) says \1 is an invalid escape. It insists
on at least 2 digits. This causes failures in test-keyword.t and test-status.t.

check-code.py already looks out for \NNN and recommends using Python
for outputting octal values. Extend the check to \NN and \N and fix up
resulting failures.
2012-02-08 16:56:00 +00:00
Mads Kiilerich
e347788597 tests: don't use alias
alias doesn't work in Solaris sh.
2012-01-27 03:00:03 +01:00
Jesus Espino Garcia
2574ec2be2 bash_completion: added -o filename option to _hg_status (issue3101) 2012-01-21 00:40:18 +01:00
Mads Kiilerich
80b4f15548 hg-ssh: use shlex for shell-like parsing of SSH_ORIGINAL_COMMAND
The Mercurial ssh protocol is defined as if it was ssh-ing to a shell account on
an ordinary ssh server, and where hg was available in $PATH and it executed
the command "hg -R REPOPATH serve --stdio".

The Mercurial ssh client can in most cases just pass REPOPATH to the shell, but
if it contains unsafe characters the client will have to quote it so the shell
will pass the right -R value to hg. Correct quoting of repopaths was introduced
in 7bec00a7d7a6 and tweaked in c3194121de6c.

hg-ssh doesn't create the command via a shell and used a simple parser instead.
It worked fine for simple paths without any quoting, but if any kind of quoting
was used it failed to parse the command like the shell would do it.

This makes hg-ssh behave more like a normal shell with hg in the path would do.
2011-12-08 16:28:18 +01:00
Mads Kiilerich
9acd1868fa tests: keep track of all check-code.py warnings 2012-01-11 01:56:05 +01:00
Martin Geisler
d8334151e6 Remove FSF mailing address from GPL headers
The GPLv3 FAQ suggests to upgrade by

  [...] replace all your existing v2 license notices (usually at the
  top of each file) with the new recommended text available on the GNU
  licenses howto. It's more future-proof because it no longer includes
  the FSF's postal mailing address.

This removes the postal address, but leaves the version number at 2+.
2012-01-06 16:27:13 +01:00
Matt Mackall
c19e8e450d merge with stable 2012-01-03 17:13:03 -06:00
Steve Borho
80262e7e1a wix: add map-commandline.bisect 2012-01-02 20:52:16 -06:00
Patrick Mezard
7a8d1bb9db test-svn-subrepo: fix reference output for svn 1.7
I modified check-code.py "$?" detection because I thought my use was legit, we
cannot test exit status of pipelines commands except for the last one without
this. So it now tolerates "[$?" which is unlikely to be added by mistake.

Tested on:
- OSX + svn 1.7.1
- Linux + svn 1.6.12
2011-12-02 16:50:48 +01:00
Matt Mackall
79f43ffdfe hgweb: add hint about finding library path with debuginstall 2011-11-10 15:08:51 -06:00
Matt Mackall
a5d3d42e92 tests: use md5sum.py instead of sha1sum, add check 2011-10-31 14:22:11 -05:00
Matt Mackall
b066b57e3c backout 17bc9a6bb165 (issue3077) (issue3071)
Using util.realpath turns out to create complex issues on both Mac and
Windows. Back this change out for the release.
2011-10-29 11:02:23 -05:00
Matt Mackall
8971e5af3c check-code: fix issues with finding patterns in unified tests, fix tests
- old-style patterns without ^ were getting improperly anchored
- finditer was matching against beginning of line poorly
- \s was matching newlines
- [^x] was matching newlines

so we:

- remove earlier hacks for multiline matching
- fix unified test anchoring by adding .*
- replace \s with [ \t]
- replace [^x] with [^\nx]
- force all matches into multiline mode so ^ anchors work

This uncovers a number of test issues that are then repaired.
2011-10-27 17:22:04 -05:00
Matt Mackall
4b52621903 tests: fix check-code detection of anchored expressions, fix echo -n usage 2011-10-26 12:56:27 -05:00
Thomas Arendsen Hein
51c498ead0 consistency: use util.realpath instead of os.path.realpath where useful
exceptions:
  hg: os.path.realpath used before util can be imported
  tests/run-tests.py: may not import mercurial modules
2011-10-24 13:51:24 +02:00
Matt Mackall
b7430f065a check-code: catch BaseException and os.path.relpath 2011-10-21 16:52:23 -05:00
Matt Mackall
b22c536335 check-code: report suspicious string joins
This detects patterns of the form:

ui.write("this is missing"
         "a space at the join\n")
2011-10-17 17:27:33 -05:00
Matt Mackall
e1cab56645 merge with crew 2011-10-16 22:15:43 -05:00
Matt Mackall
db1431fe95 check-code: support multiline matches like try/except/finally
- match one pattern at a time against entire file
- find line containing match
- sort matches by line number
2011-10-16 20:26:20 -05:00
Mads Kiilerich
4578a9a76b tests: don't use 'test -e'
On Solaris 10:

  $ test -e f
  test: argument expected
2011-10-17 00:11:56 +02:00
Idan Kamara
8bbad7ebee contrib: add a script to help diagnose raw output of the cmdserver 2011-10-14 19:10:36 +02:00
Augie Fackler
551016898f zsh completion: add support for qfinish 2011-12-12 11:54:22 -06:00
Matt Mackall
e82c2e671f merge with stable 2011-12-05 17:48:40 -06:00
Mads Kiilerich
1cbfae386c check-code: fix return code initialization
Don't crash when nothing is tested, but return failure when other files than
the last one fails.
2011-11-22 01:37:26 +01:00
Mads Kiilerich
ef0024b865 check-code: add --nolineno option for hiding line numbers
This makes the output more stable when it is used as a whitelist.
2011-11-11 01:25:47 +01:00
Matt Mackall
30c1fc3bf2 mq: add a warning about uncommitted changes for qfinish 2011-11-10 15:40:34 -06:00
Matt Mackall
d0885370c9 check-code: enable camelcase check, fix up problems 2011-11-09 16:36:54 -06:00
Nikolaj Sjujskij
7548a4a762 building: build inotify for sys.platform='linux*'
If Python interpreter was built under Linux 3.x kernel, it reports
sys.platform to be 'linux3' (it is fixed for Python 3, but not for 2.x).
This cancels building inotify extension, which was built only for 'linux2'
platform. Improved test checks if sys.platform begins with 'linux', and together
with test for kernel version to be greater than 2.6 it seems to cover all known
cases.
2011-09-20 15:21:27 +03:00
Ben Hockey
9ffafb4321 contrib: some support for named branches in zsh_completion (issue2988)
named branches were not included for autocompletion in zsh.  by adding
_hg_branches and calling it from _hg_labels, named branches are now included
when autocompleting many commands in zsh.  support for completion of hg log -b
was also added.  there are possibly other cases where support needs to be
explicitly added.
2011-09-07 10:24:26 -04:00
Augie Fackler
3a3e79d5b5 check-code: disallow use of hasattr()
The hasattr() builtin from Python < 3.2 [1] has slightly surprising
behavior: it catches all exceptions, even KeyboardInterrupt. This
causes it to have several surprising side effects, such as hiding
warnings that occur during attribute load and causing mysterious
failure modes when ^Cing an application. In later versions of Python
2.x [0], exception classes which do not inherit from Exception (such
as SystemExit and KeyboardInterrupt) are not caught, but other types
of exceptions may still silently cause returning False instead of
getting a reasonable exception.

[0] http://bugs.python.org/issue2196
[1] http://docs.python.org/dev/whatsnew/3.2.html
2011-07-25 14:59:31 -05:00
Augie Fackler
fcf9a7de39 win32/hgwebdir_wsgi: use getattr instead of hasattr 2011-07-25 16:09:18 -05:00
Augie Fackler
722b329337 setup3k: use getattr instead of hasattr
Note that hasattr is fixed on Python 3, so this is more about being
concise and keeping check-code happy than actual correctness of code.
2011-07-25 16:07:52 -05:00
Jim Hague
f6f49b778c treediscovery: rename stop() in tests to fix failures on AIX.
It seems ksh, the default shell on AIX, does not permit the creation of a
function called stop(). test-treediscovery.t and test-treediscovery-legacy.t
both fail on AIX with error 'syntax error at line 25 : `(' unexpected'.

Fix by renaming stop() in the scripts to tstop(). For completeness
rename start() to tstart() to match. Both tests then pass on AIX.

Add check for the use of stop() in a shell script to check-code.
2011-07-05 11:53:32 +01:00
Steve Borho
123c48ed44 wix: catch up with more added files
revsets:  1.7::tip and adds("mercurial/help/**")
          1.7::tip and adds("mercurial/templates/**")
2011-06-30 12:55:19 -05:00
Adrian Buehlmann
182911e62d wix: add missing templates/paper/diffstat.tmpl 2011-06-29 12:54:34 +02:00
Thomas Arendsen Hein
4575d54a81 check-code: fix class style checking (with tests)
- old-style classes were only checked for one-letter class names
- add check for new-style classes with empty parent class, because
  this is not available in Python 2.4
2011-06-29 13:45:51 +02:00
Matt Mackall
d1d59ecc8a merge with stable 2011-06-24 13:35:03 -05:00
Matt Mackall
f65681314b check-code: don't mark debug messages for translation 2011-06-21 15:21:57 -05:00
Matt Mackall
5ab97592f7 scmutil: switch match users to supplying contexts
The most appropriate context is not always clearly defined. The obvious cases:

For working directory commands, we use None
For commands (eg annotate) with single revs, we use that revision

The less obvious cases:

For commands (eg status, diff) with a pair of revs, we use the second revision
For commands that take a range (like log), we use None
2011-06-18 16:52:51 -05:00
Matt Mackall
1b52b02896 check-code: catch misspellings of descendant
This word is fairly common in Mercurial, and easy to misspell.
2011-06-07 17:02:54 -05:00
Martin Geisler
af8a35e078 check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +02:00
Idan Kamara
04f3767289 hg-ssh: fix dispatch call to use dispatch.request()
e1a0c549e195 changed dispatch.dispatch() to accept a
request object instead of a list of arguments
2011-05-29 13:43:50 +03:00
Yann E. MORIN
e113e69fa1 bash_completion: enable alias auto-complete
When auto-completing, set HGPLAINEXCEPT=alias to list aliases
in the suggestions.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-05-17 00:46:52 +02:00
Thomas Arendsen Hein
6fa586d534 bash_completion: Use "hg paths -q" instead of piping through sed 2011-05-16 11:52:28 +02:00
Matt Mackall
0832007f60 scmutil: drop aliases in cmdutil for match functions 2011-05-13 14:58:24 -05:00
Sune Foldager
58e1e8aaa9 check-code: add /= to operator list 2011-05-12 18:19:28 +02:00
Matt Mackall
81206f7383 check-code: complain about set.isdisjoint 2011-05-08 11:39:24 -05:00
Adrian Buehlmann
5573dff691 rename util.os_link to oslink 2011-05-06 15:34:34 +02:00
Adrian Buehlmann
0e6715fa28 rename util.set_binary to setbinary 2011-05-06 15:25:35 +02:00
Mads Kiilerich
938d75f22d check-code: fix checking for sh style in .t tests
Restore checks after they were disabled by a1f828662ac8.
2011-05-06 00:34:10 +02:00
Dan Villiom Podlaski Christiansen
c1ff9b1ec7 check-code: disallow calling opener(...).read() and opener(..).write() 2011-05-02 10:11:24 +02:00
Pascal Quantin
6d8379cf4b win32: remove obsolete bookmarks and parentrevspec extensions from mercurial.ini 2011-05-01 20:29:44 +02:00
timeless
849f249718 check-code: check for repo in revlog and ui in util 2011-05-01 16:11:42 +02:00
timeless
153cb7a67b check-code: allow for checking multiple pattern sets per file 2011-05-01 16:10:51 +02:00
timeless
f74ce7db63 check-code: adding debug flag 2011-05-01 15:55:00 +02:00
Steve Borho
f81fa9164b wix: a new mercurial.js has replaced graph.js 2011-04-30 11:53:57 -05:00
Augie Fackler
d47b2c1afa shrink-revlog: defend against null first parents 2011-04-29 09:28:45 -05:00
Augie Fackler
74615b75c0 shrink-revlog: use a bundler object (see cddd91650ec7) 2011-04-29 08:04:54 -05:00
Augie Fackler
fb1853a333 shrink-revlog: update util.opener to scmutil.opener after d26b1348d3f6 2011-04-29 08:01:10 -05:00
Augie Fackler
c61c6d6b7c shrink-revlog: remove \ from docstring 2011-04-29 07:38:12 -05:00
Idan Kamara
169899ab9c check-code: separate warnings to avoid repetitive str.startswith 2011-04-25 13:03:26 +03:00
Idan Kamara
83e05de083 check-code: warn about naked except clauses 2011-04-23 00:52:21 +03:00
Andreas Freimuth
0a5e675fad hg-ssh: fix duplicate word in docstring 2011-04-22 16:43:06 +02:00
Adrian Buehlmann
cf126bb7dd move opener from util to scmutil 2011-04-20 19:54:57 +02:00
Matt Mackall
a8dd64dcb0 misc: replace .parents()[0] with p1() 2011-04-04 16:21:59 -05:00
Matt Mackall
7fbf746bf2 changegroup: fold progress meter into callbacks
progress meters now start at 1 rather than 0
2011-03-28 11:18:56 -05:00
Matt Mackall
f94b6206a0 changegroup: combine infocollect and lookup callbacks 2011-03-28 11:18:56 -05:00
Dan Villiom Podlaski Christiansen
ecb9e72af1 osutil: replace #import with #include, and add a check for it 2011-03-23 23:05:32 +01:00
Matt Mackall
b156bda724 osutil: fix up check-code issues 2011-03-23 09:41:58 -05:00
Steve Borho
4b3a38e051 merge with stable 2011-03-18 13:01:18 -05:00
Steve Borho
ebbe78951f wix: add new file templates/paper/bookmarks.tmpl
This file was snuck onto the stable branch with 77ea38e46cc8
2011-03-18 11:36:36 -05:00
Steve Borho
4f66f8741b mergetools: add alternate registry keys for 32bit apps on 64bit O/S
Not all applications needed the workarounds, so I did not add alternate keys for
every Windows merge application.
2011-03-08 13:35:01 -06:00
Steve Borho
f6f81fe744 wix: drop bin/ folder from MSI installers (issue 2673)
Also fixes issue 2658.
2011-03-08 10:03:01 -06:00
Gilles Moris
cd3e15208e contrib: update tcsh_completion for Mercurial 1.8
Added the following commands: bookmarks debugignore.
Fix the tcsh parse script for the current help text layout.
2011-03-01 07:28:20 +01:00
Augie Fackler
790d2fac2d zsh completion: complete bookmarks where they are accepted
This used to work because bookmarks were pseudo-tags, but broke
once bookmarks became their own first-class object.
2011-02-28 19:15:08 -06:00
Kevin Bullock
3a4f89086c bash_completion: complete bookmarks
Since bookmarks moved into core and are no longer merged with the list
of tags (8e2d23f4bd25), they don't get completed in bash_completion
along with other revision specifiers. This adds a new function to
provide the list of bookmarks for completion, and another, _hg_labels(),
to list all tags, branches, and bookmarks. It further modifies
completion for all commands where '_hg_tags; _hg_branches' was used to
use '_hg_labels' instead.
2011-02-28 16:45:15 -06:00
David Soria Parra
362bc7e128 hgk: display bookmark in commit diff window 2011-02-23 00:25:18 +01:00
David Soria Parra
9e74296485 hgk: display bookmarks as gray labels in the commitline 2011-02-23 00:25:01 +01:00
David Soria Parra
1e08f0a83e hgk: read bookmarks 2011-02-23 00:24:21 +01:00
Dan Villiom Podlaski Christiansen
ec590d5cd4 explicitly close files
Add missing calls to close() to many places where files are
opened. Relying on reference counting to catch them soon-ish is not
portable and fails in environments with a proper GC, such as PyPy.
2010-12-24 15:23:01 +01:00
Adrian Buehlmann
281d62d169 contrib: add win32/buildlocal.bat 2011-02-13 11:14:46 +01:00
Javi Merino
20536933b3 hgk: gitk->hgk in About... menu 2011-02-14 07:39:21 +00:00
Adrian Buehlmann
77ab03f101 port win32.py to using the Python ctypes library
The pywin32 package is no longer needed.

ctypes is now required for running Mercurial on Windows.

ctypes is included in Python since version 2.5. For Python 2.4, ctypes is
available as an extra installer package for Windows.

Moved spawndetached() from windows.py to win32.py and fixed it, using
ctypes as well. spawndetached was defunct with Python 2.6.6 because Python
removed their undocumented subprocess.CreateProcess. This fixes
'hg serve -d' on Windows.
2011-02-14 11:12:26 +01:00
Martin Geisler
a76e121863 backout of e4cb9628354c
Matt and a majority of crew did not like this approach.
2011-01-27 11:15:08 +01:00
Martin Geisler
77e1343f88 check-code: do not complain about 'ls x | foo -v'
Such a line was introduced in test-subrepo-git.t in 686775e575f3,
which made check-code confused.
2011-01-26 12:35:02 +01:00
Martin Geisler
d23e1973c2 specify C indention style using Emacs file local variables 2011-01-26 12:05:01 +01:00
Matt Mackall
dc0a2bb9fd perf: restore lazyindex hack
This hack (and the module it lives in) exist so that performance can
be compared across different hg versions.
2011-01-18 15:55:49 -06:00
Benoit Boissinot
0e3e49c93d perf: there is no lazy index anymore 2011-01-15 12:28:10 +01:00
Matt Mackall
186cb7506d perf: fix ordering of invalidate in perfindex 2011-01-12 11:34:42 -06:00
Matt Mackall
76efe52d35 perf: make perfindex results useful on hg with lazyparser 2011-01-11 17:01:14 -06:00
Matt Mackall
846d35e24f revlog: only build the nodemap on demand 2011-01-11 17:01:04 -06:00
Matt Mackall
efaaee2894 revlog: remove lazy index 2011-01-04 14:12:52 -06:00
Steve Borho
8ab85e67c4 merge with stable 2011-01-08 22:15:19 -06:00
Pascal Quantin
8b6499714d win32: add cacert.pem file to Inno Setup installer 2011-01-08 11:18:38 +01:00
Patrick Mezard
da2f1496a7 bash_completion: support record command 2011-01-07 20:50:41 +01:00
Steve Borho
33365c466e wix: add an ssl certificate file to the WiX installers 2010-12-29 18:27:56 -06:00
Steve Borho
933f43725b merge with stable 2010-12-30 23:36:50 -06:00
Matt Mackall
940fa28a3f check-code: catch os.path.relpath 2010-12-16 14:50:37 -06:00
Matt Mackall
cdcb8c0f47 check-code: catch "except as" 2010-12-16 14:50:36 -06:00
Steve Borho
1d324e9771 wix: allow x86 MSI packages to be installed on x64 systems 2010-11-26 20:05:16 -06:00
Steve Borho
f2a3ea2967 wix: add support for x64 native MSI packages 2010-11-26 17:40:13 -06:00
Steve Borho
a95ec762fd wix: switch Mercurial Windows installer to use py2exe --bundle 3
--bundle 3 leaves all of the compiled C extensions and other DLLs outside of
the library.zip, so we no longer add the installer folder to the system PATH.
Instead, we now ship a small bin/hg.cmd and it is placed in the PATH.

Switching to py2exe --bundle 3 is necessary because the higher bundle options
are not supported on x64.
2010-11-26 16:18:19 -06:00
Thomas Arendsen Hein
3669dce8b1 check-code: single check for Python keywords used as a function
This replaces the specific checks for del/and/or/not/except and additionally
checks other Python keywords.
2010-12-03 12:04:31 +01:00
Thomas Arendsen Hein
31218f1044 check-code: check for gratuitous whitespace after Python keywords 2010-12-03 11:23:38 +01:00
Steve Borho
dd3fe52932 Merge with stable 2010-11-26 20:08:03 -06:00
Steve Borho
473937df1f Merge with stable 2010-11-26 18:04:10 -06:00
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
Adrian Buehlmann
5e2e71ea82 check-code: catch Python 'is' comparing number or string literals
The Python 'is' operator compares object identity, so it should
definitely not be applied to string or number literals, which Python
implementations are free to represent with a temporary object.

This should catch the following kinds of bogus expressions (examples):

  x is 'foo'     x is not 'foo'
  x is "bar"     x is not "bar"
  x is 42        x is not 42
  x is -36       x is not -36

As originally proposed by Martin Geisler, amended with catching
negative numbers.
2010-11-21 11:52:27 +01:00
Martin Geisler
ca016e40cb check-code: catch 'ls filename --option' case as per 8745def6e53b 2010-11-17 09:37:57 +01:00
Martin Geisler
9d82b9ed1f check-code: using and/or/not as a function is bad style 2010-11-11 00:08:09 +01:00
Dan Villiom Podlaski Christiansen
f385faac7a *: kill all unnecessary shebangs. 2010-10-26 12:18:39 +02:00
Dan Villiom Podlaski Christiansen
080231037c *: add executable bit to a few files that were missing it. 2010-10-26 12:18:37 +02:00
Steve Borho
85bbdcc648 wix: add subrepos help text 2010-10-25 10:07:54 -05:00
Azhagu Selvan SP
f5c025b9a9 mercurial.el: fix hg-outgoing path when 'default-push' is not defined
hg-outgoing path is set as 'default-push' which prevents it from working in
repos which only have 'default' defined.

Fix provided by Kyujin Shim at
http://alexott.net/en/writings/emacs-vcs/EmacsMercurial.html
2010-10-20 18:15:47 +05:30
Steve Borho
44d93504ff wix: add vim syntax file for Mercurial unit tests 2010-10-20 16:45:08 -05:00
Steve Borho
c84eb2535b wix: add new help page templates 2010-10-20 16:41:17 -05:00
Steve Borho
9663c6a39b wix: add new merge-tools.txt help text 2010-10-20 16:27:24 -05:00
Matt Mackall
0f064b0796 check-code: warning and fixes for whitespace in unified tests 2010-10-20 14:57:36 -05:00
Martin Geisler
77ce66fb6a check-code: find trailing whitespace 2010-10-20 10:13:04 +02:00
Adrian Buehlmann
758fc721d8 check-code: add 'no tab indent' check for unified tests
and fix the offending tests accordingly
2010-10-16 18:09:01 +02:00
Benoit Boissinot
3040e3e352 parentdelta: compress.py extension is no longer necessary
Using `hg --config format.parentdelta=True clone --pull src dst` is equivalent.
2010-10-12 08:30:15 -05:00
Benjamin Pollack
cf93a0a8f8 windows: handle spaces in path to Python (issue2074) 2010-10-09 18:04:36 +02:00
Eduard-Cristian Stefan
2ad7399c8a hgk: remember main window position 2010-10-06 23:07:52 +03:00
Steve Losh
9c8327389c contrib/vim: add a syntax file for unified tests
This syntax file adds:

* Highlighting of comments, output, and commands (with sh highlighting
  in commands).
* Folding for output and blocks of commands+output.
* Setting tab/indent settings to 2 spaces, because that's what's defined by the
  unified test file format.
2010-09-26 20:43:43 -04:00
Dan Villiom Podlaski Christiansen
8e99053714 tests: compatibility fix.
'touch -d *' doesn't work on Mac OS X. In order to prevent this from
occuring again, a check for the case is added to 'check-code.py'.
2010-09-21 18:36:23 +02:00
Matt Mackall
5d9fc42983 tests: drop a bunch of sed calls from unified tests 2010-09-21 16:44:13 -05:00
Matt Mackall
0c59a109d6 check-code: add some basic support for unified tests 2010-09-21 12:41:24 -05:00
Matt Mackall
a624bd1945 bundle: fix shrink-revlog bundle usage 2010-09-20 16:25:29 -05:00
Matt Mackall
4b4d939b00 bundle: get rid of chunkiter 2010-09-19 12:51:54 -05:00
Matt Mackall
43940bec52 bundle: make getchunk() a method 2010-09-18 18:20:34 -05:00
Pascal Quantin
8779a2558c win32: update build instructions with correct CRT version
As stated in http://msdn.microsoft.com/en-us/library/cc664727.aspx, when you
compile an application with MSVC 2008 SP1 it is bound by default to the
original CRT version (9.0.21022.8). This is the case for Python 2.6 up to 3.1.
If the wrong CRT version is embedded in the Inno Setup installer, with a PC
that does not have the MSVC 2008 redistributable package installed, hg will
refuse to launch with an error: "the system cannot execute the specified
program".
2010-09-16 11:36:38 +02:00
Pascal Quantin
79b606ed69 win32: 64-bit Inno Setup installer 2010-09-11 18:48:03 +02:00
Pascal Quantin
58f110611d win32: update Inno Setup build instructions with up-to-date software 2010-09-11 09:48:10 +02:00
Brendan Cully
fc79a72f03 zsh completion: bookmarks support 2010-09-05 13:37:17 -07:00
Brendan Cully
94254d16e4 zsh completion: patchbomb support 2010-09-04 01:32:01 -07:00
Martin Geisler
c3c7fa090f Merge with stable 2010-08-30 13:00:22 +02:00
Pascal Quantin
80eb33b604 win32: add hgweb scripts to Inno Setup installer 2010-08-29 23:16:31 +02:00
Pascal Quantin
be74e290e0 win32: add Emacs scripts to Inno Setup installer 2010-08-29 22:57:24 +02:00
Mads Kiilerich
cd19e3668d mercurial.spec: specify file modes for install 2010-08-26 23:11:03 +02:00
Martin Geisler
1b1861d1eb Merge with stable 2010-08-27 13:18:25 +02:00
Benoit Boissinot
2a5344e149 contrib/compress: compress should activate parentdelta 2010-08-22 19:41:04 +02:00
Benoit Boissinot
f1dc9e3787 contrib/compress: correct ordering of copying
Changelog should always be copied last, otherwise readers can see an
inconsistent repo.
2010-08-22 19:27:09 +02:00
Benoit Boissinot
b68994148f contrib/compress: refactor revlog copying 2010-08-22 19:26:07 +02:00
Benoit Boissinot
ca7a857d7d contrib/compress: use store API instead of a collector 2010-08-22 19:13:30 +02:00
Benoit Boissinot
984cffb62e contrib/compress: proper lock handling
Lock the src repo before beginning the compression and lock the destination
repo before copying the revlogs.
Proper handling of exceptions.
2010-08-22 18:29:30 +02:00
Benoit Boissinot
349b6aaab5 contrib/compress: use hg API to compute the destination path 2010-08-22 18:23:32 +02:00
Benoit Boissinot
e7a85d1ff5 contrib/compress: use repo's transaction method 2010-08-22 18:21:30 +02:00
Benoit Boissinot
75b2e19c12 contrib/compress: remove unused variables 2010-08-22 18:18:36 +02:00
Yann E. MORIN
f3a35cc478 mq/qqueue: update bash completion 2010-08-18 23:37:26 +02:00
Renato Cunha
49f7aba937 hgfixes: added a fixer to convert changes in the email package
This patch adds a fixer that accounts for changes in python packages, as the
framework provided by lib2to3 is only able to track changes in module names.
This fixer (hopefully) can fix any change in one-level hierarchies.

To exemplify, this fixer can successfully change an import from
"email.MIMEMultipart" to "email.mime.multipart".
2010-08-08 15:48:58 -03:00
Renato Cunha
c4578da8bf contrib/setup3k.py: added script to build hg with py3k
This patch implements a script that inherits most of its functionality from
hg's setup.py and adds support to calling 2to3 during invocation with python3.
The motivation of having this script around is twofold:

 1) It enables py3k crazies to test mercurial in py3k and, hopefully, patch it
    more easily, so it can improve the py3k support to eventually run there.

 2) Being separated from the main setup.py eliminates the need to make hg's
    setup.py even more cluttered, and enables "independent" development until
    the port is done.

Some considerations about the structure of this patch:

Mercurial already overrides the behavior of build_py, this patch tweaks it a bit
more to add support to call 2to3 with a custom fixer* location for Mercurial.
There is also a need of having the core C modules built *before* the
translation process starts, otherwise 2to3 will think those are global modules.

* A fixer is a python module that transforms python 2.x code in python 3.x
code.
2010-08-03 13:18:16 -03:00
Pradeepkumar Gayam
a444183249 contrib: simple extension to practically convert a repo from tip delta to parentdelta 2010-08-10 22:28:30 +05:30
Martin Geisler
ec0bf03276 Merge with stable 2010-08-15 18:13:46 +02:00
Martin Geisler
888421d8ca check-code: catch "echo -n" in tests 2010-08-15 17:48:05 +02:00
Mads Kiilerich
e26e44a190 mercurial.spec: gettext is a build requirement for getting proper localization 2010-08-14 01:31:57 +02:00
Martin Geisler
e7bd3fc69a Merge with stable 2010-08-14 03:30:35 +02:00
Alecs King
00c728120d check-code: add exit status
so that we can use it in a shell command combination and/or in hg hooks.
2010-08-12 16:42:41 +08:00
Yann E. MORIN
af2d086089 mq/qqueue: enable bash completion
Return the list of available queues when completion is attempted on qqueue.
2010-08-08 23:10:08 +02:00
Renato Cunha
f65cf06e03 check-code: added a check for calls to the builtin cmp function 2010-08-07 16:13:53 -03:00
Yuya Nishihara
3cdd1e55b0 zsh completions: add qpush --move option 2010-08-07 15:32:33 +09:00
Renato Cunha
49c247ab1e hgfixes: added a fixer that makes bytes to be formatted correctly
This patch implement a fixer that replaces all calls to the '%' when bytes
arguments are used to a call to bytesformatter(), a function that knows how to
format byte strings. As one can't be sure if a formatting call is done when
only variables are used in a '%' call, these calls are also translated. The
bytesformatter, in runtime, makes sure to return the "raw" % operation if
that's what was intended.
2010-08-03 13:59:14 -03:00
Renato Cunha
48aa19eddb py3kcompat: added a "compatibility layer" for py3k
This patch adds some ugly constructs. The first of them is bytesformatter, a
function that formats strings like when '%' is called. The main motivation for
this function is py3k's strange behavior:

>>> 'foo %s' % b'bar'
"foo b'bar'"
>>> b'foo %s' % b'bar'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for %: 'bytes' and 'bytes'
>>> b'foo %s' % 'bar'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for %: 'bytes' and 'str'

In other words, if we can't format bytes with bytes, and recall that all
mercurial strings will be converted by a fixer, then things will break badly if
we don't take a similar approach.

The other addition with this patch is that the os.environ dictionary is
monkeypatched to have bytes items. Hopefully this won't be needed in the
future, as python 3.2 might get a os.environb dictionary that holds bytes
items.
2010-08-03 13:52:48 -03:00
Renato Cunha
09994866c3 hgfixes: add a fixer to convert plain strings to bytestrings
This patch implements a 2to3 fixer that converts all plain strings in a python
source file to byte strings syntax. Example:

foo = 'Normal string'

would become

foo = b'Normal string'

The motivation behind this fixer can be found in
http://selenic.com/pipermail/mercurial-devel/2010-June/022363.html or, in other
words: the current hg source assumes that _most_ strings are "meant" to be byte
sequences, so it makes sense to make the convertion implemented by this patch.

As mentioned above, not all mercurial modules want to use strings as bytes,
examples include i18n (which uses unicode), and demandimport (in py3k, module
names are normal strings, thus unicode, and there's no need for a convertion).
Therefore, these modules are blacklisted in the fixer. There are also a few
functions that can take only unicode arguments, thus the convertion shouldn't
be done for those.
2010-08-03 13:41:47 -03:00
Nicolas Dumazet
3186d42f7f perf: break down long line 2010-07-31 11:41:42 +09:00
Pradeepkumar Gayam
02c67b2a97 perf: add perfrevlog function to check performance of revlog 2010-07-27 20:50:09 +05:30
Matt Mackall
661034417e check-code: add warning on lines over 80 characters 2010-07-25 17:10:32 -05:00
Brodie Rao
bfa13e8d9a bash/zsh completion: use HGPLAIN when invoking hg (issue2297) 2010-07-21 17:06:00 -04:00
Martin Geisler
71971a8928 check-code: warn about untranslated ui.warn calls 2010-07-16 14:40:57 +02:00
Martin Geisler
177012ed6e Merge with stable 2010-07-22 10:49:55 +02:00
Vishakh H
dc91b670e1 contrib: add debugshell extension 2010-07-20 23:29:49 +05:30
Matt Mackall
6c780d7b4f check-code: add --blame switch 2010-07-16 13:26:39 -05:00
Martin Geisler
12085cad2b check-code: catch dict.has_key 2010-07-16 14:48:52 +02:00
Martin Geisler
f985c9d777 Merge with stable 2010-07-16 14:45:52 +02:00
Renato Cunha
29ee0d7c07 check-code: added check for reduce usage 2010-07-14 23:15:03 -03:00
Renato Cunha
f678753e0c check-code: check for tuple parameter unpacking (missing in py3k) 2010-07-14 23:15:00 -03:00
Martin Geisler
5fbbb27c25 Merge with stable 2010-07-09 14:21:45 +02:00
Martin Geisler
59385f10e8 check-code: add test for callable 2010-07-09 14:01:55 +02:00
Martin Geisler
9fd4048b8f Merge with stable 2010-07-06 20:43:19 +02:00
Martin Geisler
fabfcd3971 mergetools.hgrc: add vimdiff
Imported from deb_specific__mergetools patch in Debians patch queue:

  http://svn.debian.org/viewsvn/python-apps/packages/mercurial/trunk/debian/patches/
2010-07-03 02:15:25 +02:00
Martin Geisler
6ae5a495d7 hgweb.wsgi: add a URL to the corresponding wiki documentation
Imported for_upstream__add_doc_url_in_example_files.patch from
Debian's patch queue:

  http://svn.debian.org/viewsvn/python-apps/packages/mercurial/trunk/debian/patches/
2010-07-03 01:48:50 +02:00
Steve Borho
3f177d32a4 wix: generate a new GUID for the help folder
A GUID change is recommended after changes like 857ab17725c0
2010-07-01 19:13:23 -05:00
Steve Borho
a10936e8ce wix: pick up new help topics added between 1.5 and 1.6
These files are not included the 1.6.0 installer, but will be picked up by
nightly builds as soon as this makes it to the stable branch.
2010-07-01 12:53:37 -05:00
Mads Kiilerich
20a31caeb0 mercurial.spec: don't include convert-repo - use "hg convert" instead 2010-06-25 19:59:22 +02:00
Gilles Moris
b51db262e6 contrib: update tcsh_completion with commands for 1.6
Added the following commands: debugbuilddag debugdag debugpushkey
debugrevspec.
2010-06-26 15:56:48 +02:00
Martin Geisler
5bd48f2f1e check-code: reformat long lines 2010-06-15 10:01:55 +02:00
Martin Geisler
28297c8184 check-code: catch format(), introduced in Python 2.6 2010-06-15 09:55:59 +02:00
Martin Geisler
5d9db0b74d check-code: fix check for any/all function
The old check would only detect any/all at the beginning of a line.
The regexp was probably just modeled after the preceding regexp which
(correctly) finds the 'with' keyword at the beginning of a line.

We now complain about 'any(' and 'all(' anywhere in a line, unless it
is preceded by 'def'. This allows us to define our own compatibility
wrapper in util and use 'util.any(' in the code.
2010-06-15 09:51:52 +02:00
Steve Borho
74a14c2364 mergetools: add configuration for Ultra Compare (issue2226)
Initial config provided by Tim Pietzcker
2010-06-08 11:58:09 -05:00
Pradeepkumar Gayam
ade05bacc0 shrink-repo: wrong variable name 2010-06-06 22:39:32 +05:30
Greg Ward
6e1d6aff0f shrink-revlog: use util.mktempcopy() to preserve mode of index file.
(There's still a chmod() call to manually preserve the mode of the
data file.)
2010-06-03 10:18:33 -04:00
Martin Geisler
ae18c6a910 win32text: mark this extension as deprecated 2010-06-02 14:54:25 +02:00
Martin Geisler
e73685cb49 Merge with stable 2010-06-02 14:40:31 +02:00
Greg Ward
cb24398037 shrink-revlog: preserve mode of the shrunken index and data file.
Otherwise, the shrunken index file always has mode 0600 thanks to
mkstemp(). This is annoying on a server, where multiple users may need
to read/write the manifest. chmod()ing the data file is not strictly
necessary, but it's nice for consistency.
2010-06-01 18:29:52 -04:00
Yuya Nishihara
ffeee8dfd0 check-code: add check for 'source' 2010-05-21 22:53:57 +09:00
Julian Cowley
270cd1a3b9 mercurial.spec: rename docutils to python-docutils in BuildRequires
Even though the name of the project is Docutils, most packagers use
the package name python-docutils to fit into the naming scheme of
other packages written in Python.  The name is used by Fedora, EPEL,
DAG, Mandriva, and a few other distributions.
2010-07-02 14:14:30 -10:00
Steve Borho
912f22c7ae merge with stable 2011-03-08 14:55:31 -06:00
Steve Borho
a549e552c4 merge with stable 2011-03-08 10:25:18 -06:00
Martin Geisler
950ba1a21f zsh completion: remove computed default values from help texts
The default encoding and encoding mode are computed at runtime and can
vary from system to system. The two remaining default values in the
completion help texts (number of directories to strip on import and
default bundle name) are fixed in the source code.
2011-03-08 11:01:01 +01:00
Martin Geisler
e8a21642ee check-code: catch "echo > $HGRCPATH" too
Make error message consistent with the other error messages.
2011-03-02 14:52:31 +01:00
Martin Geisler
11500eaa6f check-code: better check for overwriting $HGRCPATH
Suggested by Mads Kiilerich on IRC.
2011-03-02 14:22:50 +01:00
Martin Geisler
83c27fb95f tests: don't overwrite HGRCPATH
Overwriting instead of appending to the file removes the [defaults]
section put into the file by run-tests.py.

It also defeats the --inotify option to run-tests.py.

(Nothing was broken yet, but the lack of -d "0 0" cause changeset
hashes to change unexpectedly in a test case I was editing.)
2011-03-01 17:01:17 +01:00
Steve Borho
c76d6b8145 extdiff: add labels, read diff arguments from [merge-tools]
hgtk has been using these same configs since Feb. Users only have to name the
tools they would like to use, ex:

[extdiff]
kdiff3 =
meld =
2010-01-07 22:19:05 -06:00
David Champion
8d642796c6 give worst-case 'merge' merge-tool lowest priority
Another tool had -10 already.  Since 'merge' is clearly a worst-case
tool (internal), lowering to -100 ensures there's plenty of room for
slightly better cases.
2010-04-21 12:02:51 -05:00
Mads Kiilerich
df529b99ae contrib/mercurial.spec: Use DESTDIR variable and 'make install' 2010-04-19 11:31:19 +02:00
Adrian Buehlmann
a3eefcc44b wix: new GUID for contrib.guid
to comply with the component GUID rules of Windows Installer, applied to
the change 5f884a9e81ee
2010-04-27 09:47:33 +02:00
Mads Kiilerich
da86b3d27f contrib/mercurial.spec: drop git-viz
Follow-up to a8ccf53d3400
2010-04-19 11:00:36 +02:00