Commit Graph

16592 Commits

Author SHA1 Message Date
Brodie Rao
391c9b5bf1 check-code: improve detection of naked except clauses 2012-05-13 13:17:50 +02:00
Brodie Rao
46ce54af4d cleanup: replace more naked excepts with more specific ones 2012-05-13 13:17:31 +02:00
Brodie Rao
47a3ca1c2f check-code: promote 80+ character line warning to an error 2012-05-13 13:17:27 +02:00
Patrick Mezard
2cddd7a828 cmdutil: use filectx.cmp() in amend() 2012-05-13 13:19:46 +02:00
Na'Tosha Bard
0af9bc5a7f largefiles: optimize performance when updating (issue3440)
Previously, when updating, cachelfiles was called blindly on all largefiles
in the repository at the revision being updated to, despite the fact that
a list of which largefiles needs to be updated has already been collected.  This
optimization constrains the cachelfiles call to only the largefiles that need
to be updated.

On a repository with about 80 largefiles, updating between two revisions that
only change one largefile goes from approximately 6.7 seconds to 3.3 seconds.
2012-05-12 15:41:27 +02:00
Matt Mackall
05e48d4041 merge with stable 2012-05-13 12:52:24 +02:00
Bryan O'Sullivan
18be3ce9f0 tests: make test-convert-darcs.t happier with darcs 2.8.0 2012-05-13 11:47:55 +02:00
Matt Mackall
732d9d463a merge with i18n 2012-05-13 11:19:48 +02:00
Levi Bard
ff2ee52b29 bookmarks: pull new bookmarks from remote by default (BC) 2012-05-12 17:00:01 +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
Patrick Mezard
f49c9eec1a subrepo: do not traceback on .hgsubstate parsing errors
Note that aborting in subrepo.state() prevents "repairing" commands like revert
to be issued. The user will have to edit the .hgsubstate manually (but he
probably had already otherwise this would not be failing). The same behaviour
already happens with invalid .hgsub entries.
2012-05-04 14:19:55 +02:00
Patrick Mezard
a124dced40 subrepo: ignore blank lines in .hgsubstate (issue3424)
Reported by Sebastian Krysmanski <infomail@lordb.de>
2012-05-04 14:19:52 +02:00
hlian
992a6313f9 largefiles: in putlfile, ensure tempfile's directory exists prior to creation
Let R be a repo served by an hg daemon on a machine with an empty largefiles
cache. Pushing a largefiles repo to R will result in a no-such-file-or-directory
OSError because putlfile will attempt to create a temporary file in
R/.hg/largefiles, which does not yet exist.

This patch also adds a regression test for this scenario.
2012-05-04 14:36:40 -04:00
Patrick Mezard
d99bfab018 rebase: allow collapsing branches in place (issue3111)
We allow rebase plus collapse, but not collapse only? I imagine people would
rebase first then collapse once they are sure the rebase is correct and it is
the right time to finish it.

I was reluctant to submit this patch for reasons detailed below, but it
improves rebase --collapse usefulness so much it is worth the ugliness.

The fix is ugly because we should be fixing the collapse code path rather than
the merge. Collapsing by merging changesets repeatedly is inefficient compared
to what commit --amend does: commitctx(), update, strip. The problem with the
latter is, to generate the synthetic changeset, copy records are gathered with
copies.pathcopies(). copies.pathcopies() is still implemented with merging in
mind and discards information like file replaced by the copy of another,
criss-cross copies and so forth. I believe this information should not be lost,
even if we decide not to interpret it fully later, at merge time.

The second issue with improving rebase --collapse is the option should not be
there to begin with. Rebasing and collapsing are orthogonal and a dedicated
command would probably enable a better, simpler ui. We should avoid advertizing
rebase --collapse, but with this fix it becomes the best shipped solution to
collapse changesets.

And for the record, available techniques are:
- revert + commit + strip: lose copies
- mq/qfold: repeated patching() (mostly correct, fragile)
- rebase: repeated merges (mostly correct, fragile)
- collapse: revert + tag rewriting wizardry, lose copies
- histedit: repeated patching() (mostly correct, fragile)
- amend: copies.pathcopies() + commitctx() + update + strip
2012-05-03 15:14:58 +02:00
Adrian Buehlmann
65a9a97e69 diffhelpers: use Py_ssize_t in testhunk()
Eliminates

  mercurial/diffhelpers.c(143) : warning C4244: '=' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/diffhelpers.c(144) : warning C4244: '=' : conversion from
  'Py_ssize_t' to 'int', possible loss of data

when compiling for Windows x64 target using the Microsoft compiler.
2012-05-12 14:00:51 +02:00
Adrian Buehlmann
0a73f19992 diffhelpers: use Py_ssize_t in addlines()
Eliminates

  mercurial/diffhelpers.c(81) : warning C4244: '=' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/diffhelpers.c(82) : warning C4244: '=' : conversion from
  'Py_ssize_t' to 'int', possible loss of data

when compiling for Windows x64 target using the Microsoft compiler.
2012-05-12 13:21:08 +02:00
Adrian Buehlmann
930b763535 diffhelpers: use Py_ssize_t in _fix_newline()
Eliminates

  mercurial/diffhelpers.c(23) : warning C4244: 'initializing' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/diffhelpers.c(26) : warning C4244: 'initializing' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/diffhelpers.c(27) : warning C4244: 'initializing' : conversion from
  'Py_ssize_t' to 'int', possible loss of data
  mercurial/diffhelpers.c(30) : warning C4244: 'initializing' : conversion from
  'Py_ssize_t' to 'int', possible loss of data

when compiling for Windows x64 target using the Microsoft compiler.
2012-05-12 12:07:18 +02:00
Na'Tosha Bard
18869bf5f2 largefiles: add --all-largefiles flag to pull 2012-05-12 11:45:22 +02:00
Na'Tosha Bard
faa9f04319 largefiles: refactor downloading of all largefiles to generic function 2012-05-12 09:59:01 +02:00
Mads Kiilerich
803e845d28 unbundle: move bookmark update outside the lock
abf413aa5fdc introduced updatecurrentbookmark after unbundle, but that path
might end up taking a wlock after lock when writing the bookmarks.
2012-05-12 20:06:04 +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
a7ef0a0cc5 cleanup: "not x in y" -> "x not in y" 2012-05-12 16:00:57 +02:00
Brodie Rao
2db5d441ca cleanup: replace hasattr() usage with getattr() in hghave 2012-05-12 16:00:53 +02:00
Brodie Rao
dd09ae96e9 cleanup: "x != None" -> "x is not None" 2012-05-12 15:56:23 +02:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
Martin Geisler
1e5a14b6b5 progress: fix indentation 2012-05-11 18:41:04 +02:00
Martin Geisler
194d85c712 test-progress: fix whitespace typo 2012-05-11 15:13:13 +02:00
Matt Mackall
4d12f82b66 merge with stable 2012-05-12 13:20:26 +02:00
Bryan O'Sullivan
058dfb801d revlog: speed up prefix matching against nodes
The radix tree already contains all the information we need to
determine whether a short string is an unambiguous node identifier.
We now make use of this information.

In a kernel tree, this improves the performance of
"hg log -q -r24bf01de75" from 0.27 seconds to 0.06.
2012-05-12 10:55:08 +02:00
Bryan O'Sullivan
f29187cd15 parsers: ensure that nullid is always present in the radix tree 2012-05-12 10:55:08 +02:00
Bryan O'Sullivan
4fe1bcbdb1 parsers: allow hex keys 2012-05-12 10:55:07 +02:00
Matt Mackall
8420ca3aee merge with stable 2012-05-12 12:23:49 +02:00
Henrik Stuart
97ebbbffd1 revset: add function for matching extra data (issue2767) 2012-05-12 10:20:57 +02:00
David Soria Parra
7bbe0ff197 pager: check if signal.SIGPIPE exists
We have to check for signal.SIGPIPE before we attempt
to set it.
2012-05-12 09:43:12 +02:00
Matt Mackall
360a8e9fb8 diffhelpers: harden testhunk 2012-05-12 10:02:47 +02:00
Yuya Nishihara
9228db24a3 patch: fix segfault against unified diffs which start line is zero
Since f7e538c3b7ba, if a chunk starts with "@@ -0,1", oldstart turns into
a negative value. Because diffhelpers.testhunk() doesn't expect negative bstart,
it bypasses "alen > blen - bstart" condition and segfaults at
"PyList_GET_ITEM(b, i + bstart)".
2012-05-12 16:10:01 +09:00
Steven Stallion
66e5651b6d bugzilla: fix transport initialization on python 2.4 2012-05-11 22:48:19 -07:00
Levi Bard
4d4fd8dd61 graft: implement --log (issue3438) 2012-05-11 18:51:35 +02:00
Patrick Mezard
aa6e824ce1 phase: make if abort on nullid for the good reason
The good reason being you cannot call retractboundary() on nullid, not
revset.set() cannot resolve '-1'.
2012-05-12 00:24:07 +02:00
Patrick Mezard
ed5fc49c44 phases: make advance/retractboundary() atomic
Before this, if advanceboundary() failed after updating some roots but
before calling retractboundary(), the phase cache would be left in an
invalid state, marked dirty, and written as such. This patch approach is
to turn advance/retractboundary() into phasecache methods, then operate
on copies and merge them back on success.

With the same technique, we can ensure the atomicity of combinations of
advance/retractboundary() calls, like those performed in changegroup
handling code.
2012-05-12 00:24:07 +02:00
Patrick Mezard
641ee7d3ba phases: introduce phasecache
The original motivation was changectx.phase() had special logic to
correctly lookup in repo._phaserev, including invalidating it when
necessary. And at other places, repo._phaserev was accessed directly.

This led to the discovery that phases state including _phaseroots,
_phaserev and _dirtyphase was manipulated in localrepository.py,
phases.py, repair.py, etc. phasecache helps encapsulating that.

This patch replaces all phase state in localrepo with phasecache and
adjust related code except for advance/retractboundary() in phases.
These still access to phasecache internals directly. This will be
addressed in a followup.
2012-05-12 00:24:07 +02:00
Patrick Mezard
f06b17a700 mq: introduce mq.check setting
When:

  [mq]
  check = True

is set, qpush, qpop and qgoto behave as if -c/--check were passed. If
incompatible options like -f/--force or --exact are set, this setting is
ignored.

This setting enables what many users expect mq default behaviour to be.
2012-05-12 00:19:30 +02:00
Patrick Mezard
93529cbc7c mq: introduce qgoto --check 2012-05-12 00:19:30 +02:00
Patrick Mezard
b9c8ba9be4 mq: introduce qpush --check
qpush --check let you qpush with uncommitted files not overlapping
patched files.
2012-05-12 00:19:30 +02:00
Patrick Mezard
55a575b59a mq: introduce qpop --check
qpop --check let you qpop with uncommitted files if they do not
intersect with files touched by the popped patches.
2012-05-12 00:19:30 +02:00
Bryan O'Sullivan
2493c7a8d1 bisect: set HG_NODE when runing a command
When running a command, set the environment variable HG_NODE to
tell the command which changeset is being visited.
2012-05-08 15:31:00 -07:00