Commit Graph

20211 Commits

Author SHA1 Message Date
Pierre-Yves David
ab2b4d5db8 push: move remote argument in the push object
One more step toward a more modular push function.
2014-01-30 16:57:01 -08:00
Pierre-Yves David
97abb80300 push: ease access to current ui object
The `pushoperation.repo.ui` attribute is very commonly used. we offer a faster way
to access it directly through the push operation object.
2014-01-30 16:46:30 -08:00
Pierre-Yves David
836dd3b929 push: introduce a pushoperation object
This object will hold all data and state gathered through the push. This will
allow us to split the long function into multiple small one. Smaller function
will be easier to maintains and wrap.  The idea is to blindly store all
information related to the push in this object so that each step and extension
can use them if necessary.

We start by putting the `repo` variable in the object. More migration in other
changeset.
2014-01-30 16:43:11 -08:00
Pierre-Yves David
f35f0a3cb0 exchange: extract push function from localrepo
The localrepo class if far too big. Push and pull logic will be extracted and
reworked to better fit with the fact they now exchange more than plain changeset
bundle.

This changeset extract the push code. later changeset will slowly slice this
over 200 hundred lines and 8 indentation level function into smaller saner
brick.

The localrepo.push method is kept for now to limit impact on user code. But it
will be ultimately removed, now that the public supposed API is hold by peer.
2014-01-30 15:34:01 -08:00
Pierre-Yves David
4a16e8a21b phase: properly compute ancestors of --rev on push (issue3786)
Now that discovery is working on unfiltered changeset, I had a good occasion to
look at that bug again. This let me realise that a trivial node vs rev
comparision was the cause of this two years old bugs…

Happy second birthday phases!
2013-01-28 15:16:49 +01:00
Simon Heimberg
dd6f92d843 hgext: fix one typo in rebase 2014-01-23 01:21:08 +01:00
Simon Heimberg
f9ed3a6ac4 templater: selecting a style with no templates does not crash (issue4140)
Running `hg log --style compact` (or any other style) raised a traceback when
no template directory was there. Now there is a message:

Abort: style 'compact' not found
(available styles: no templates found, try `hg debuginstall` for more info)


There is no test because this would require to rename the template directory.
But this would influence other tests running in parallel. And when the test
would be aborted the wrong named directory would remain, especially a problem
when running with -l.
2014-01-23 01:29:50 +01:00
Matt Mackall
ccdc2e59b8 makefile: add $ to environment variables in help message 2014-01-23 14:31:05 -06:00
Matt Mackall
496d57be29 Added signature for changeset eb40daab10ae 2014-01-21 14:44:40 -06:00
Matt Mackall
4075699ace merge with i18n 2014-01-21 14:44:01 -06:00
Wagner Bruna
a9d7c8df74 i18n: fix trailing '::' on translated messages
Reported by FUJIWARA Katsunori <foozy@lares.dti.ne.jp>.
2014-01-20 11:16:26 -02:00
Mads Kiilerich
ec9b6c203b tests: stop tracking tests/gpg/random_seed
test-gpg.t left the random_seed file as modified. That was slightly confusing
... and it was accidentally changed in 7e8ce69e784d.

The seed is created on demand and there is no reason to track it. There is also
no reason to leak state between test runs so we let the test clean up after
running.
2014-01-20 01:29:54 +01:00
Mads Kiilerich
5be7383671 tests: 'hghave tic' also requires curses support in Python
test-status-color.t would fail when using a Python without curses.
2014-01-20 01:29:54 +01:00
Matt Mackall
805df56652 test-import-merge: mangle file in binary mode
This should fix a test breakage on Windows.
2014-01-20 17:09:20 -06:00
Matt Mackall
47af0ab954 localrepo: drop dead comment 2014-01-19 22:58:33 -06:00
Jordi Gutiérrez Hermoso
aeb19f9922 record: re-enable whitespace-ignoring options
It looks like somewhere down the line, patch.diffopts changed the
names of the options that it recognises, but record.recordfunc wasn't
updated to the new names. Instead of trying to write down names at
all, we now use whatever names are provided in commands.diffwsopts and
pass that along to patch.diffopts, along with a couple of custom
options
2014-01-16 15:05:03 -05:00
Jordi Gutiérrez Hermoso
ccf7869bdf record: use commands.diffwsopts instead of ad-hoc diffopts
The record extension is writing its own version of commands.diffwsopts
which is identical to commands.diffwsopts. Based on the principle that
code duplication increases maintenance burden, this patch removes
record's ad-hoc diffopts in favour of commands.diffwsopts
2014-01-16 14:57:52 -05:00
David Soria Parra
b0e2d02402 i18n-de: rename noun "entfernt" to "Gegenseite"
The German translation for "remote" as "entfernt" can be misleading
in situations where remote is used as a noun. "entfernt" is not a
noun and can also mean "removed". To clarify this we rename "remote"
to "Gegenseite" when used as a noun.
2014-01-08 12:25:00 -08:00
Matt Mackall
258b088046 Added signature for changeset 6b943a1e0510 2014-01-01 21:46:45 -06:00
Matt Mackall
bef1d17e4e merge with i18n 2014-01-01 21:46:03 -06:00
FUJIWARA Katsunori
45d24ef0b8 i18n-ja: synchronized with 9525dc6ef7d6 2013-12-30 21:30:34 +09:00
Yuya Nishihara
cb7a1dd14c fileset, revset: do not use global parser object for thread safety
parse() cannot be called at the same time because a parser object keeps its
states.  This is no problem for command-line hg client, but it would cause
strange errors in multi-threaded hgweb.

Creating parser object is not too expensive.

original:
% python -m timeit -s 'from mercurial import revset' 'revset.parse("0::tip")'
100000 loops, best of 3: 11.3 usec per loop

thread-safe:
% python -m timeit -s 'from mercurial import revset' 'revset.parse("0::tip")'
100000 loops, best of 3: 13.1 usec per loop
2013-12-21 12:44:19 +09:00
Matt Mackall
03adb7cbe4 hgweb: avoid initialization race (issue3953) 2013-12-04 13:42:28 -06:00
Matt Mackall
c4f5764d33 mpatch: rewrite pointer overflow checks 2013-12-11 18:33:42 -06:00
Matt Mackall
68554e4b42 tests: fix missing import in check-translations 2013-12-01 21:24:26 -06:00
Matt Mackall
e539bfb887 Added signature for changeset b000784e52a9 2013-12-01 20:51:15 -06:00
Matt Mackall
a7756031f0 tests: fix Mac doctest escape code garbage for check-translations 2013-12-01 20:39:11 -06:00
Wagner Bruna
1f2bdd921d i18n-pt_BR: synchronized with 5d367afa6755 2013-12-01 18:26:42 -02:00
Andrew Shadura
e4287fe436 hgk: fix tag list parser (issue4101)
As tags may have embedded spaces, and "hg tags" command doesn't escape them,
the output of the command doesn't make a well-formed list, so we can't just
iterate over it. Instead, apply a simple regexp to transform it to a list
which we actually use. Line boundary matching should be enabled.
2013-12-01 13:53:24 -06:00
Matt Mackall
c6b13a6bbd merge with i18n 2013-12-01 13:45:00 -06:00
Wagner Bruna
d61a68e7a9 i18n-pt_BR: fix wording in tag command help text 2013-11-30 21:50:40 -02:00
FUJIWARA Katsunori
4f41aff6b6 i18n-ja: synchronized with 5cdd099776c7 2013-11-28 20:10:47 +09:00
FUJIWARA Katsunori
3535aee6e1 i18n: add the tool to check Mercurial specific translation problems in *.po
Existing tool like "msgfmt --check" can check typical translation
problems (missing "%s" in msgstr, for example), but can't check
Mercurial specific ones.

For example, "msgfmt --check" can't check whether the translated
string given to "ui.promptchoice()" is correct or not, even though
problems like below cause run-time error or unexpected behavior:

  - less or more choices than msgid,
  - choices without '&', or
  - choices with '&' followed by none

This patch adds the tool to check Mercurial specific translation
problems in *.po files.
2013-11-27 22:47:32 +09:00
Santiago Pay=C3=A0 i Miralta
42d271f1db help: fix backwards bisect help example 2013-11-27 22:32:01 +01:00
Durham Goode
3357a8eb2b unshelve: add tests for unknown files
Adds a basic test for shelving/unshelving with an unknown file present.

Adds a test for unshelving on top of an existing unknown file.
2013-11-26 16:30:52 -08:00
Durham Goode
0b43211792 unshelve: don't commit unknown files during unshelve (issue4113)
Previously, unshelve would temporarily commit unknown files (via addremove) in
an attempt to allow unshelving into unknown files.  This produced unexpected
results, like the file time stamp changing and a .i file being created.

This change makes it no longer use addremove.  It ignores unknown files
completely.  If an unshelve would overwrite an unknown file, the unknown file is
moved to *.orig

The shelve continue/abort format is changed, but it just removes stuff from the
end of the file, so it can still read the old format.
2013-11-26 16:23:05 -08:00
Mads Kiilerich
f2255e8146 largefiles: don't crash on 'local renamed directory' actions
a8386b4c47b1 introduced splitstandin on all action filenames. It would however
crash on 'd' actions where the filename is None.

Fix that and add test coverage for that case.
2013-11-26 15:38:33 +01:00
Wagner Bruna
22b11e7b78 i18n-pt_BR: synchronized with 5131f2755f60 2013-11-26 11:00:49 -02:00
Martin Geisler
6907950b0d glossary: don't mention obsolete graphlog extension 2013-11-22 19:13:07 +01:00
Martin Geisler
8b1b36c645 bisect: don't mention obsolete graphlog extension in help 2013-11-22 19:12:44 +01:00
Martin Geisler
dc22476982 contrib: don't mention obsolete graphlog extension in mercurial.ini 2013-11-22 19:12:18 +01:00
Martin Geisler
477180c942 contrib: stop mentioning obsolete graphlog extension in sample.hgrc 2013-11-22 19:11:48 +01:00
Martin Geisler
422edf9e4c contrib: promote strip extension over MQ in sample.hgrc 2013-11-22 17:14:44 +01:00
Matt Mackall
ed6ec26983 help: use progress instead of mq as in 'hg help config' example 2013-11-22 17:12:43 +01:00
Chris Jerdonek
e02a62783a parse_index2: fix crash on bad argument type (issue4110)
Passing a non-string to parsers.parse_index2() causes Mercurial to crash
instead of raising a TypeError (found on Mac OS X 10.8.5, Python 2.7.6):

    import mercurial.parsers as parsers
    parsers.parse_index2(0, 0)

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0 parsers.so  0x000000010e071c59 _index_clearcaches + 73 (parsers.c:644)
    1 parsers.so  0x000000010e06f2d5 index_dealloc + 21 (parsers.c:1767)
    2 parsers.so  0x000000010e074e3b parse_index2 + 347 (parsers.c:1891)
    3 org.python.python 0x000000010dda8b17 PyEval_EvalFrameEx + 9911

This happens because when arguments of the wrong type are passed to
parsers.parse_index2(), indexType's initialization function index_init() in
parsers.c leaves the indexObject instance in a state that indexType's
destructor function index_dealloc() cannot handle.

This patch moves enough of the indexObject initialization code inside
index_init() from after the argument validation code to before it.
This way, when bad arguments are passed to index_init(), the destructor
doesn't crash and the existing code to raise a TypeError works.  This
patch also adds a test to check that a TypeError is raised.
2013-11-26 16:14:22 -08:00
Pierre-Yves David
0420ab83f5 phases: add a formal note that hash of secret changeset may leak out
For technical reason (discovery, obsolescence marker) the hash of secret
changeset are communicated outside of your repo. We clarifie that in the help so
that people does not used hash of secret changeset as nuclear launch code.
2013-11-17 11:30:17 -05:00
Mads Kiilerich
5c02304224 largefiles: stylistic cleanup of filemerge 2013-11-16 15:54:41 -05:00
Mads Kiilerich
19967e8476 largefiles: show hashes before prompting for conflict resolution
The largefile hashes are mostly an implementation detail, but they are "leaked"
in several places anyway, and showing the hashes is better than not giving the
user any information about the options in the prompt.

The hashes are long, but it is largefile hashes and it would thus be confusing
to shorten them.
2013-11-16 15:46:29 -05:00
Mads Kiilerich
d6cfe18be7 largefiles: don't try to explain rename history before prompt for conflicts
Before it tried to explain the exact situation when merging moved largefiles.
That do not happen for normal merges and is not more relevant for largefiles
than for normal files. It is unneeded complexity - remove it.
2013-11-16 15:46:29 -05:00
Mads Kiilerich
af7f586373 largefiles: drop redundant special handling of merges of renames
It is unclear what cases this was supposed to cover but it do no longer seem
relevant.
2013-11-16 15:46:29 -05:00