Commit Graph

11925 Commits

Author SHA1 Message Date
Nicolas Dumazet
801c0daa61 tests: unify test-symlink-addremove 2010-08-12 22:58:46 +09:00
Nicolas Dumazet
d6a2a4a2c9 tests: unify test-qimport-eol 2010-08-12 22:57:06 +09:00
Nicolas Dumazet
471c4cf4cf tests: unify test-import 2010-08-12 22:54:41 +09:00
Adrian Buehlmann
6a1422f607 tests: unify test-clone 2010-08-10 13:21:28 +02:00
Nicolas Dumazet
3b18bed439 tests: unify test-copy 2010-08-12 22:31:40 +09:00
Nicolas Dumazet
ccfb72c083 tests: unify test-commit-unresolved 2010-08-12 22:28:21 +09:00
Nicolas Dumazet
ec59bd6b58 unify test-commit-copy 2010-08-12 22:24:13 +09:00
Nicolas Dumazet
557c241888 tests: unify test-commit 2010-08-12 22:22:17 +09:00
Nicolas Dumazet
2f67722fbe tests: unify test-committer 2010-08-12 22:19:59 +09:00
Nicolas Dumazet
6e81695eb4 tests: unify test-transplant 2010-08-12 22:14:19 +09:00
Nicolas Dumazet
374b7abbbe tests: unify test-walk 2010-08-12 21:52:53 +09:00
Nicolas Dumazet
a2e261b3b3 tests: unify test-symlinks 2010-08-12 20:08:02 +09:00
Nicolas Dumazet
5f6ee46e39 tests: unify test-conflict 2010-08-12 20:02:59 +09:00
Nicolas Dumazet
8242afcae6 tests: unify test-identify 2010-08-12 19:49:58 +09:00
Nicolas Dumazet
582515a1a6 tests: unify test-add 2010-08-12 19:43:45 +09:00
Nicolas Dumazet
39fada51ff tests: remove useless sed in test-hook 2010-08-12 19:40:22 +09:00
Nicolas Dumazet
fdbcb407cb tests: unify test-hook 2010-08-12 19:38:31 +09:00
Nicolas Dumazet
2f73e7a983 tests: unify test-flags 2010-08-12 19:10:57 +09:00
Nicolas Dumazet
96827d742a repair: do not compress partial bundle if we do not keep it on disk
A partial bundle is created to temporarily save revisions > rev but
not descending from the node to strip, to be able to restore the
changesets after stripping the changelog.
Since this bundle is not kept after the strip operation, and is not
user-visible, it is not necessary and should be faster to avoid
compression.
2010-08-12 16:53:23 +09:00
Nicolas Dumazet
d7e4800c8b store: skip decodir check if path does not contain '.hg/'
The three replace calls are slower than this simple __contains__,
and anyway we should not have this many paths ending with .i, .d, or .hg
compared to the normal, un-encoded other paths.
2010-08-12 16:45:47 +09:00
Matt Mackall
45ca4e347d color: fix test-diff-color breakage 2010-08-04 13:21:11 -05:00
Brodie Rao
0f7e715bdb hgcia/color: remove star imports
This plays nicer with demandimport and allows pyflakes to detect undefined
names.
2010-08-03 13:02:11 -04: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
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
Renato Cunha
cedeb488b2 mq: save qrefresh message for easy recovery in case it fails (issue2062)
Currently, if you start editing a commit message from qrefresh -e and, for any
reason: forget you were editing it, leave the editor open and start qpopping
and qpushing, when you decide to save your commit message, it is going to fail.
This patch copies the commit behavior of saving the message contents in
$HGROOT/.hg/last-message.txt before continuing.
2010-08-16 16:35:20 -03:00
Sol Jerome
c9dfe23c62 util: avoid using hashlib on Python < 2.5 (issue2278)
The following patch allows the use of python2.4 with a standalone
hashlib rather than assuming that python2.5 is in use when hashlib is
imported successfully.
2010-08-17 17:38:19 -05:00
Alecs King
3065ca2943 ui: differentiate empty configlist from None 2010-08-11 20:28:39 +08:00
Wagner Bruna
64365a9e84 revset: predicate to avoid lookup errors
A query like

head() and (descendants("bad") and not descendants("fix"))

(testing if repo heads are affected by a bug) will abort with a
RepoLookupError if either badrev or fixrev aren't found inside
the repository, which is not very informative.

The new predicate returns an empty set for lookup errors, so

head() and (descendants(present("bad")) and not descendants(present("fix")))

will behave as wanted even if those revisions are not found.
2010-08-13 13:11:41 -03:00
Greg Ward
41733adeb2 inotify: show the exact command used to start the server 2010-08-13 13:16:34 -04:00
Dan Villiom Podlaski Christiansen
d8105bddb7 demandimport: store level argument on _demandmod instances
The 'level' argument to __import__ was added in Python 2.6, and is
specified for either relative or absolute imports. The fix introduced
in 5b0fda8ff209 allowed such imports to proceed without failure, but
effectively disabled demandimport for them. This is particularly
unfortunate in Python 3.x, where *all* imports are either relative or
absolute.

The solution introduced here is to store the level argument on the
demandimport instance, and propagate it to _origimport() when its
value isn't None.

Please note that this patch hasn't been tested in Python 3.x, and thus
may not be complete. I'm worried about how sub-imports are handled; I
don't know what they are, or whether the level argument should be
modified for them. I've added 'TODO' notes to these cases; hopefully,
someone more knowledgable of these issues will deal with them.
2010-08-17 17:46:10 +02:00
Xavier Snelgrove
edea98c84f revert: use opts.get
If you want to programatically perform a revert right now you need to
include a date=False parameter due to the use of opt["date"] instead
of opt.get("date").
2010-08-13 13:59:26 -04:00
Pradeepkumar Gayam
b10bf9f64c tests: unify test-copy2 2010-08-17 08:38:31 +05:30
Yann E. MORIN
087fc5dff2 mq/qqueue: enable renaming of active queue 2010-08-15 13:29:46 +02:00
Yann E. MORIN
cc2af00728 mq/qqueue: split _setactive
Prepare _setactive to be called without checking for applied patches.
2010-08-15 16:48:08 +02:00
Matt Mackall
c0507148ea merge with stable 2010-08-17 13:22:20 -05:00
Matt Mackall
6d39631884 templates: add filenolink to raw style (issue2332) 2010-08-16 12:55:42 -05:00
Matt Mackall
d6488d66cb revlog: optimize deltachain 2010-08-15 23:13:56 -05:00
Pradeepkumar Gayam
fb9106e388 manifest: correct readdelta() according to parentdeltas 2010-08-10 22:28:52 +05:30
Pradeepkumar Gayam
a444183249 contrib: simple extension to practically convert a repo from tip delta to parentdelta 2010-08-10 22:28:30 +05:30
Pradeepkumar Gayam
e2c89f7a97 localrepo: add parentdelta to requires only if enabled in config file 2010-08-10 22:28:08 +05:30
Pradeepkumar Gayam
2257cdb06d revlog: append delta against p1 2010-08-10 22:27:41 +05:30
Pradeepkumar Gayam
dada7ee47c revlog: teach revlog to construct a revision from parentdeltas 2010-08-10 22:27:16 +05:30
Pradeepkumar Gayam
eeeffb2335 revlog: deltachain() returns chain of revs need to construct a revision 2010-08-10 22:26:08 +05:30
Pradeepkumar Gayam
65e80a1e8d revlog: parentdelta flags for revlog index 2010-08-10 22:25:08 +05:30
Martin Geisler
0d581ef071 Merge with stable 2010-08-17 17:27:37 +02:00
Adrian Buehlmann
9e497d8fac tests: unify test-clone-r 2010-08-15 20:36:49 +02:00
Pradeepkumar Gayam
73ddda7459 tests: unify test-debugcomplete 2010-08-17 18:07:05 +05:30
Pradeepkumar Gayam
2c038276c3 tests: unify tests-debugindexdot 2010-08-17 18:04:04 +05:30