Commit Graph

42 Commits

Author SHA1 Message Date
Yuya Nishihara
3e663dde68 registrar: move cmdutil.command to registrar module (API)
cmdutil.command wasn't a member of the registrar framework only for a
historical reason. Let's make that happen. This patch keeps cmdutil.command
as an alias for extension compatibility.
2016-01-09 23:07:20 +09:00
Augie Fackler
4e1c384d0a extensions: change magic "shipped with hg" string
I've caught multiple extensions in the wild lying about being
'internal', so it's time to move the goalposts on people. Goalpost
moving will continue until third party extensions stop trying to
defeat the system.
2016-08-23 11:26:08 -04:00
Yuya Nishihara
a5c934df3c py3: move up symbol imports to enforce import-checker rules
Since (b) is banned, we should do the same for (a) for consistency.

 a) from mercurial import hg
    from mercurial.i18n import _

 b) from . import hg
    from .i18n import _
2016-05-14 14:03:12 +09:00
timeless
37728f6a24 relink: use absolute_import 2016-03-02 21:36:14 +00:00
timeless@mozdev.org
716b455ed5 l10n: use %d instead of %s for numbers 2015-10-14 22:29:03 -04:00
Pierre-Yves David
30913031d4 error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.

For great justice.
2015-10-08 12:55:45 -07:00
Gregory Szorc
5380dea2a7 global: mass rewrite to use modern exception syntax
Python 2.6 introduced the "except type as instance" syntax, replacing
the "except type, instance" syntax that came before. Python 3 dropped
support for the latter syntax. Since we no longer support Python 2.4 or
2.5, we have no need to continue supporting the "except type, instance".

This patch mass rewrites the exception syntax to be Python 2.6+ and
Python 3 compatible.

This patch was produced by running `2to3 -f except -w -n .`.
2015-06-23 22:20:08 -07:00
Augie Fackler
f95a6caba1 extensions: document that testedwith = 'internal' is special
Extension authors (notably at companies using hg) have been
cargo-culting the `testedwith = 'internal'` bit from hg's own
extensions, which then defeats our "file bugs over here" logic in
dispatch. Let's be more aggressive about trying to give extension
authors a hint about what testedwith should say.
2015-04-28 16:44:37 -04:00
Gregory Szorc
a47c384be9 relink: declare command using decorator 2014-05-04 21:52:25 -07:00
Simon Heimberg
527ea5386e relink: abort earlier when on different devices (issue3916)
Add a first check of the devices before collecting candidate files. This is
much quicker when big repos are on different devices.
Keep the existing check in prune. It checks for same device of the files. This
could probably be different in a special repo store (with symlinks).
2013-11-09 14:50:58 +01:00
Simon Heimberg
9e6ca20cff repo: repo isolation, do not pass on repo.ui for creating new repos
A repo should not get the configuration from an other repo, so create it with
the global configuration in repo.baseui.
This is done too when recreating a repo. The repo configuration is reread
anyway. And now deleted repo configuration does not persist.
2012-10-10 21:55:49 +02:00
Sune Foldager
ffe56435bf peer: introduce peer methods to prepare for peer classes
This introduces a peer method into all repository classes, which currently
simply returns self. It also changes hg.repository so it now raises an
exception if the supplied paths does not resolve to a localrepo or descendant.

Finally, all call sites are changed to use the peer and local methods as
appropriate, where peer is used whenever the code is dealing with a remote
repository (even if it's on local disk).
2012-07-13 21:46:53 +02:00
Augie Fackler
96d44b39f7 hgext: mark all first-party extensions as such 2012-05-15 14:37:49 -05:00
Brodie Rao
a7ef0a0cc5 cleanup: "not x in y" -> "x not in y" 2012-05-12 16:00:57 +02:00
Augie Fackler
3fddb45056 hgext: replace uses of hasattr with util.safehasattr 2011-07-25 20:37:12 -05:00
Matt Mackall
f65681314b check-code: don't mark debug messages for translation 2011-06-21 15:21:57 -05:00
Matt Mackall
efecb99535 hg: change various repository() users to use peer() where appropriate
This gets all the easy cases (peers that aren't also used as repositories).
2011-06-10 11:43:38 -05:00
Adrian Buehlmann
5573dff691 rename util.os_link to oslink 2011-05-06 15:34:34 +02:00
Martin Geisler
3c1a708683 relink: correct unusual indentation 2011-04-06 15:26:49 +02:00
Martin Geisler
9b725c9bcb merge with stable 2011-03-16 16:07:06 +01:00
Martin Geisler
87e06b967c relink: mark abort message for translation 2011-03-16 15:34:45 +01:00
Martin Geisler
ba5898d620 relink: avoid trying to lock the same repo twice 2011-03-16 15:34:10 +01:00
Martin Geisler
af8080dec2 relink: format reclaimed byte count nicely 2011-03-16 13:51:47 +01:00
timeless
6c6a718e86 progress: dropping superfluous space from units 2010-07-20 20:53:48 +02:00
Brodie Rao
203cf2fbd9 cleanup: remove unused imports 2010-08-27 13:32:38 -04:00
Martin Geisler
0cbec6eadd relink: ensure deterministic directory walk in collect 2010-06-16 12:22:14 +02:00
timeless
675858ac70 relink/progress: Adding progress for collecting stage 2010-06-10 15:35:06 +02:00
timeless
6ffa07b04b relink/progress: Adding progress for pruning stage 2010-06-10 13:09:50 +02:00
Matt Mackall
86ebd43d71 remoteui: move from cmdutil to hg 2010-06-01 11:18:57 -05:00
Martin Geisler
f25789e50f relink: removed unneeded local variable 2010-05-01 16:15:55 +02:00
Matt Mackall
6e515e4e5d progress: drop extra args for pos=None calls (issue2087) 2010-03-17 18:15:16 -05:00
Martin Geisler
f3b2ed5d56 progress: use a verb (+noun) in present participle 2010-03-15 18:33:39 +01:00
Augie Fackler
0a5d2046b5 relink: properly use the progress API 2010-02-07 10:25:18 -06:00
Matt Mackall
cd3ef170f7 Merge with stable 2010-01-19 22:45:09 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Martin Geisler
d19ed4f0b8 relink: ensure consistent candidate order 2010-01-09 23:16:36 +01:00
Siddharth Agarwal
eab3968819 Add support for relinking on Windows.
Test and minor code change by Patrick Mézard <pmezard@gmail.com>
2010-01-08 18:48:39 +05:30
Martin Geisler
3da08922b3 relink: do not translate format string with no text 2009-11-08 00:11:34 +01:00
Jesse Glick
1c304ddf8b Issue919: add a standard extension to recreate hardlinks between repositories.
Having to run a standalone Python script from the contrib dir is a nuisance.
Also makes various improvements to locking, file discovery, etc.
Should also update: http://www.selenic.com/mercurial/wiki/index.cgi/RecreateHardlinksBetweenRepositories
2009-11-05 17:38:03 -05:00
Martin Geisler
8b3eb73040 Merge with stable 2010-01-09 23:16:48 +01:00
Patrick Mezard
032c355a2a Merge with crew-stable 2010-01-09 00:25:56 +01:00
Martin Geisler
250b1b2a94 relink: wrap long lines in docstring 2009-11-08 00:27:15 +01:00