Commit Graph

20496 Commits

Author SHA1 Message Date
Olle Lundberg
492c3a2ebf setdiscovery: document algorithms used
This is taken from:
http://programmers.stackexchange.com/questions/208998
And modified slightly.
2014-03-06 12:37:28 +01:00
Simon Heimberg
ff9aaaba6b doc: gendoc.py creates valid output for option descriptions with newlines
gendoc.py did not handle the hanging indentation for descriptions. Work around
this by joining all in one single line (same as in minirst since previous
patch).

This problem occurred when translations of option lines were very long. Do not
bother the translators with this detail.

On a long option description, the translator continued on a new line as usual.
gendoc.py created invalid rst syntax like this:

-o, --option
    Description line 1
description line 2

The new output is:

-o, --option
    Description line 1 description line 2

The lines could theoretically become very long, but line breaking is handled
when generating the final documentation.
2014-02-20 09:17:22 +01:00
Simon Heimberg
0aad267371 minirst: create valid output when table data contains a newline
When table data contained a newline, the result of minirst.maketable
did not look nice plus it was not recognised by minirst.format:
  == === ====
  l1 1   one
  l2 2   2
22
  l3
  == === ====

This problem occurred when the description of options had a very long
translation which was split by newlines. Do not bother a translator with
this detail.

The multiline translations for option descriptions have been fixed in
7a88a81d5d9e in it.po, de.po and ro.po. I manually did the same as this patch
does, I removed the newlines.

When a newline was in the description, this created unusable help output:
  $ hg help somecommand
  hg somecommand [option]...

  with somecommand, you can...

  options:

  == =================== =======================================================
  =================================== --longdesc VALUE    xxxxxxxxxxxxxxxxxxxxxx
  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -n --norm
  normal desc --newline VALUE line1 line2 == =================== ===============
  ===========================================================================

now this looks much nicer:
  ...
  options:

      --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   -n --norm           normal desc
      --newline VALUE  line1 line2
2014-02-19 17:32:21 +01:00
Simon Heimberg
cd665814c5 tests: match time by a glob to fix intermittent failures of test-lock-badness.t
Sometimes the lock was a bit slower and took 2 seconds. Do not fail the test by
this.
The glob ? matches from 0 to 9 seconds, which should be enough safety.
2014-03-05 14:03:08 +01:00
Pierre-Yves David
c559733782 merge: adds documentation to the mergestate class
Document most the new function involved in the new serialisation process (and a
few others).
2014-03-05 10:49:43 -08:00
Pierre-Yves David
2cdc06eb49 merge: add blank line between mergestate's method
This class is now too big to be a single big block of continuous text.
2014-03-05 10:22:43 -08:00
Yuya Nishihara
b6eb1297a9 cmdserver: allow to start server without repository
Typical use case is to clone repository through command server.  Clone may
require user interaction, so command-server protocol is beneficial over
raw stdio channels.
2014-03-03 23:21:24 +09:00
Yuya Nishihara
8fcb453c5c cmdserver: prepare test for starting server without repository 2014-03-03 23:11:17 +09:00
Olle Lundberg
572e5a90a5 histedit: move logic for finding child nodes to new function
This function will be used in later patches.
2014-03-06 01:24:03 +01:00
Olle Lundberg
eafad841b7 histedit: clean up lock imports
We are alread importing the release function from lock, no need
to actually import the module too.
2014-03-05 22:02:45 +01:00
Lucas Moscovicz
4eff61057b localrepo: changed revs to use spanset instead of baseset
Performance benchmarking:

$ time hg log -qf -l1
...

real  0m1.420s
user  0m1.249s
sys 0m0.167s

$ time ~/local/hg/hg log -qf -l1
...

real  0m0.719s
user  0m0.614s
sys 0m0.103s
2014-03-05 17:42:05 -08:00
Ed Morley
33ad7df82b extensions: use normpath to allow trailing '\' on Windows (issue4187)
Fixes same issue as 3dadbacb6aa4 but now works on Windows too.

With this patch a trailing backward slash won't prevent the extension from
being found on Windows, and we continue to support any combination of forward
and back slashes within the path.
2014-03-05 09:31:05 +00:00
Matt Mackall
eb09e501b5 tests: fix unused imports from inotify removal caught by pyflakes 2014-03-04 09:56:59 -06:00
Lucas Moscovicz
e87d3ac6ae revset: added ordered generatorset classes with __contains__ method
They stop iterating as soon as they go past the value they are looking for,
so, for values not in the generator they return faster.
2014-02-27 17:27:03 -08:00
Mads Kiilerich
f6187cda8d merge: use the right ancestor when both sides copied the same file
The tests shows no real changes because of this ... but there must be some
weird corner cases where using the right ancestor for the merge planning is
better than using the wrong one.
2014-02-25 20:29:46 +01:00
Mads Kiilerich
43ddf0086b copies: when both sides made the same copy, report it as a copy
Not used yet ... but shows up in debug output.
2014-02-25 20:29:14 +01:00
Mads Kiilerich
24ed93fbb6 merge: handle create+delete prompts in calculateupdates
I would like to move it all the way to the interactive resolve state like
merges are ... but this is a first intermediate step.
2014-03-02 18:36:02 +01:00
Mads Kiilerich
23f515d5c2 merge: handle acceptremove of create+delete early in manifest merge 2014-02-28 02:26:03 +01:00
Mads Kiilerich
7ee3d68332 largefiles: override calculateupdates instead of manifestmerge
That will give calculateupdates a purpose in life ... and be convenient later.
2014-03-02 18:30:41 +01:00
Mads Kiilerich
b991c5191a tests: add systematic test of merge ancestor calculation
There is probably some overlap with the existing tests - it is hard to figure
out what these tests are doing.
2014-02-25 20:28:40 +01:00
Mads Kiilerich
7162028f03 tests: add test case for criss cross merge
The test do not fit in any existing test file...
2014-03-02 18:25:19 +01:00
Matt Mackall
c9e6159ca7 merge with stable 2014-03-03 15:34:09 -06:00
Lucas Moscovicz
d710c5103e revset: changed generatorset code to remove unnecesary function call
Removed _nextitem() method, now __iter__ has that logic and __contains__ uses
__iter__ to check for membership.
2014-03-03 12:54:46 -08:00
Yuya Nishihara
6edf7b4a6a phase: say "Returns 0" instead of "Return 0" like other command help 2014-03-03 15:50:45 +09:00
anuraggoel
2e25e2e790 paper: overlapping of section title on help pages (issue4051)
Now there will be no overlap lines between various section title
on help pages. http://selenic.com/repo/hg/help/config
2014-03-03 23:37:59 +05:30
Yuya Nishihara
0cf2db5155 dirstate: remove double imports of errno 2014-03-03 15:50:41 +09:00
Yuya Nishihara
da4723cea3 cmdserver: mask return code of runcommand in the same way as dispatch.run
"hg help" does not state that the code for abort is 255, but it's confusing
to have different code between hg command and command server.

Tests of python-hglib 1.2 passed with this change.
2014-03-03 15:50:51 +09:00
Yuya Nishihara
4d6229a6b6 cmdserver: include non-zero return code of runcommand in test output 2014-03-03 15:50:48 +09:00
Yuya Nishihara
16bbd89ec4 cmdserver: recreate mq object on runcommand in case queue path was changed
repo.mq needs to be recreated after queue path change.  Since there is little
benefit to keep invalidated mq object, it always delete repo.mq.
2014-03-03 19:41:30 +09:00
Yuya Nishihara
ff2e18c10c cmdserver: reload mq on each runcommand request to avoid corruption
If mq was changed by another process, command server should invalidate caches.
Otherwise, mq status would go wrong.
2014-03-03 19:41:26 +09:00
Yuya Nishihara
cb7c7a6489 localrepo: add hook point to invalidate everything on each command-server run
MQ extension will wrap this function to invalidate its state.

repo.invalidate cannot be wrapped for this purpose because qpush obtains
repo.lock in the middle of the operation, triggering repo.invalidate.  Also,
it seems wrong to obtain lock earlier because mq data is non-store parts.
2014-03-03 19:41:23 +09:00
Matt Mackall
b41bd8b777 contrib: drop tmplrewrite
Needed for the 1.3 transition in 2009, no longer relevant
2014-03-01 20:08:41 -06:00
Matt Mackall
8953a169ba extensions: mark win32text deprecated
Happened a long time ago.
2014-03-01 19:51:22 -06:00
Matt Mackall
3e1e5c2044 extensions: remove interhg
Has been built-in for a few releases.
2014-03-01 19:44:14 -06:00
Matt Mackall
66c8bd54e8 extensions: remove the inotify extension (BC)
This extension has always had correctness issues and has been
unmaintained for years. It is now removed in favor of the third-party
hgwatchman which is maintained and appears to be correct.

Users with inotify enabled in their config files will fall back to
standard status performance.
2014-03-01 16:20:15 -06:00
Augie Fackler
e5cf4ffdba merge main and crew 2014-03-01 21:08:43 -05:00
Augie Fackler
5b6342a4d8 merge with stable 2014-03-01 21:08:28 -05:00
Matt Mackall
ab34056fed Added signature for changeset c6d901b5cf89 2014-03-01 15:22:49 -06:00
Mads Kiilerich
6c40916e6d merge: audit the right destination file when merging with dir rename 2014-03-01 18:09:39 +01:00
Augie Fackler
3da355d794 merge with mpm 2014-03-01 09:30:23 -05:00
Augie Fackler
957de138ce test-help.t: fix for non-Linux platforms 2014-03-01 09:21:45 -05:00
Matt Mackall
53c79c65e4 config: make repo optional again 2014-02-27 23:17:37 -06:00
Olle Lundberg
bee0a3e630 merge: fix spelling of length 2014-02-28 02:28:12 +01:00
Pierre-Yves David
3eab08d896 resolve: use "other" changeset from merge state (issue4163)
We can use the "other" data from the recorded merge state instead of inferring
what the other could be from working copy parent. This will allow resolve to
fulfil its duty even when the second parent have been dropped.

Most direct benefit is fixing a regression in backout.
2014-02-25 18:45:01 -08:00
Pierre-Yves David
f2a2751552 merge: add "other" file node in the merge state file
This data is mostly redundant with the "other" changeset node (+ other changeset
file path). However, more data never hurt.

The old format do not store it so this require some dancing to add and remove it
on demand.
2014-02-25 18:54:47 -08:00
Pierre-Yves David
49ce770140 merge: infer the "other" changeset when falling back to v1 format
When we have to fallback to the old version of the file, we infer the
"other" from current working directory parent. The same way it is currently done
in the resolve command. This is know to have shortcoming… but we cannot do
better from the data contained in the old file format. This is actually the
motivation to add this new file format.
2014-02-27 14:14:57 -08:00
Pierre-Yves David
15afb2ca0c merge: record the "other" node in merge state
We need to record the merge we were merging with. This solve multiple
bug with resolve when dropping the second parent after a merge. This
happen a lot when doing special merge (overriding the ancestor).
Backout, shelve, rebase, etc. can takes advantage of it.

This changeset just add the information in the merge state. We'll use it in the
resolve process in a later changeset.
2014-02-25 18:42:11 -08:00
Pierre-Yves David
b5e943e8cb merge: introduce new format for the state file
This new format will allow us to address common bugs while doing special merge
(graft, backout, rebase…) and record user choice during conflict resolution.

The format is open so we can add more record for future usage.

This file still store hexified version of node to help human willing to debug
it by hand. The overhead or oversize are not expected be an issue.

The old format is still used. It will be written to disk along side the newer
format. And at parse time we detect if the data from old version of the
mergestate are different from the one in the new version file. If its the same,
both have most likely be written at the same time and you can trust the extra
data from the new file. If it differs, the old file have been written by an
older version of mercurial that did not knew about the new file. In that case we
use the content of the old file.
2014-02-25 18:37:06 -08:00
Pierre-Yves David
01a482bed9 merge: change the merge state serialisation to use a record based logic
The format of the file is unchanged. But we are preparing a new file with a new
format that would be record based. So we change all the read/write logic to
handle a list of record until a very low level. This will allow simple plugging
of the new format in the current code.
2014-02-27 12:59:41 -08:00
Pierre-Yves David
2438827558 merge: move merge state file path into a constant
We are about to change the format. Having the file path in a single place make
it easier to update the filename for the new version.
2014-02-25 17:14:49 -08:00