Commit Graph

34029 Commits

Author SHA1 Message Date
Yuya Nishihara
cab88e001f py3: don't pass bytes to array.array() 2017-09-16 22:42:19 +09:00
Yuya Nishihara
f726056d04 py3: wrap bytes in encoding.from/toutf8b() with bytestr 2017-09-03 15:54:29 +09:00
Yuya Nishihara
cd2add86f9 py3: iterate bytes as a byte string in store.lowerencode() 2017-09-03 17:28:47 +09:00
Yuya Nishihara
12ba8b8351 py3: use bytechr() in store._buildlowerencodefun() 2017-09-03 17:27:50 +09:00
Yuya Nishihara
1c1ae74c58 store: give name to lowerencode function
lambda function isn't easy to track in traceback.
2017-09-03 17:26:10 +09:00
Yuya Nishihara
8a515cf238 py3: iterate bytes as a byte string in dagparser.py 2017-09-03 15:32:45 +09:00
Yuya Nishihara
e122413500 py3: wrap string constants in dagparser.py with bytestr() 2017-09-03 15:28:39 +09:00
Yuya Nishihara
2f65d15f59 py3: drop use of str() in dagparser.py 2017-09-03 15:25:50 +09:00
Yuya Nishihara
8c52ede766 dagparser: fix variable name in error message
There's no variable named 'type'.
2017-09-03 15:22:54 +09:00
Yuya Nishihara
81c2aaf747 py3: convert function name to bytes in ui.configwith() 2017-09-03 17:47:21 +09:00
Augie Fackler
34ec2fe8db drawdag: port to python 3 2017-08-23 01:23:16 -04:00
Augie Fackler
23df90a15a drawdag: add a couple of doctests to help with python3 porting 2017-08-23 10:51:26 -04:00
Augie Fackler
f2c654c577 drawdag: tagsmod.tag() takes a list of names, not a single name
We were getting lucky on Python 2 since we have only one-byte names,
but on Python 3 badness was happening.
2017-08-23 01:24:01 -04:00
Augie Fackler
af109efa42 bruterebase: port to python 3 2017-08-23 01:22:59 -04:00
Augie Fackler
8585259ff1 exchange: use '%d' % x instead of str(x) to encode ints
Recommended by Yuya instead of using pycompat.bytestr() in this case.
2017-08-22 21:21:13 -04:00
Augie Fackler
d68f01169b posix: always pass a native str to unicodedata.normalize's first arg 2017-09-15 19:44:32 -04:00
Augie Fackler
e4d2f96bbd posix: use slicing to grab a single byte out of a bytes in HFS+ normcase code 2017-09-15 19:44:05 -04:00
Augie Fackler
7fd201a134 encoding: ensure getutf8char always returns a bytestr, never an int 2017-09-15 19:43:32 -04:00
Augie Fackler
e6768c401f posix: fix HFS+ normcase doctest to produce valid bytes literals in Python 3
We were previously getting lucky on Python 2.
2017-09-15 19:43:02 -04:00
Augie Fackler
e7f35bd20c tests: add and remove some (glob) markers
I have no idea if these changes are reasonable, but they look like
they'd help on the Windows buildbot.
2017-09-15 22:08:25 -04:00
Pulkit Goyal
64bd8ed9ad uncommit: move fb-extension to core which uncommits a changeset
uncommit extension in fb-hgext adds a uncommit command which by default
uncommits a changeset and move all the changes to the working directory. If
file names are passed, uncommit moves the changes from those files to the
working directory and left the changeset with remaining committed files.

The uncommit extension in fb-hgext does not creates an empty commit like the one
in evolve extension unless user has specified ui.alllowemptycommit to True.

The test file added is a combination of tests from test-uncommit.t,
test-uncommit-merge.t and test-uncommit-bookmark.t from fb-hgext.

.. feature::

   A new uncommit extension which provides `hg uncommit` using which one can
   uncommit part or all of the changeset. This command undoes the effect of a
   local commit, returning the affected files to their uncommitted state.

Differential Revision: https://phab.mercurial-scm.org/D529
2017-08-24 22:55:56 +05:30
Gregory Szorc
545ec2de44 show: use consistent (and possibly shorter) node lengths
`hg show` makes heavy use of shortest() to limit the length of the node
hash.

For the "stack" and "work" views, you are often looking at multiple
lines of similar output for "lines" of work. It is visually appeasing
for things to vertically align. A naive use of {shortest(node, N)}
could result in variable length nodes and for the first character of
the description to vary by a column or two.

We implement a function to determine the longest shortest prefix for
a set of revisions. The new function is used to determine the printed
node length for all `hg show` views.

.. feature::

   show: use consistent node length in views

Our previous shortest node length of 5 was arbitrarily chosen.

shortest() already does the work of ensuring that a partial node
isn't ambiguous with an integer revision, which is our primary risk
of a collision for very short nodes. It should be safe to go with the
shortest node possible.

Existing code is also optimized to handle nodes as short as 4.

So, we decrease the minimum hash length from 5 to 4.

We also add a test demonstrating that prefix collisions increase the
node length.

.. feature::

   show: decrease minimum displayed hash length from 5 to 4

Differential Revision: https://phab.mercurial-scm.org/D558
2017-09-13 21:15:46 -07:00
Gregory Szorc
f95c9311db show: pass the minimum length for nodes as a template keyword
This will allow us to make the displayed length configurable
and/or dynamic.

Differential Revision: https://phab.mercurial-scm.org/D556
2017-08-03 21:51:34 -07:00
Gregory Szorc
c904fe4a55 cmdutil: allow extra properties to be added to each context
The changeset displayer allows setting extra keywords to be available
to the templating layer. This patch adds an argument to displaygraph()
to pass a dict of extra properties to be available to every changeset.

Differential Revision: https://phab.mercurial-scm.org/D555
2017-08-03 21:13:27 -07:00
Michael Bolin
454c5f00c6 dirstate: perform transactions with _map using single call, where possible
This is in the same style as https://phab.mercurial-scm.org/D493.

In general, this replaces patterns such as:

```
f in self._map:
    entry = self._map[f]
```

with:

```
entry = self._map.get(f):
if entry is not None:
    # use entry
```

Test Plan:
`make tests`

Differential Revision: https://phab.mercurial-scm.org/D663
2017-09-14 09:41:22 -07:00
Boris Feld
80d3295191 extensions: register config item early
Config items are likely to be used in during extensions setup. So we much
register them before that.

For example this apply to the 'win32text.warn' options.
2017-09-05 00:34:13 +02:00
Boris Feld
8744970b58 extensions: factor extra data loading out
Some of the extra data need to be registered earlier than they currently are
(eg: config items). We first factor out the logic to registered them in a small
function before reusing it in the next changeset.
2017-09-05 00:31:59 +02:00
Boris Feld
5de8ff4a6a configitems: register the 'win32text.warn' config 2017-06-30 03:45:56 +02:00
Boris Feld
4345bf1f3c configitems: register the 'mq.secret' config 2017-06-30 03:43:17 +02:00
Boris Feld
470745da2b configitems: register the 'mq.plain' config 2017-06-30 03:43:16 +02:00
Boris Feld
c931b71704 configitems: register the 'mq.keepchanges' config 2017-06-30 03:43:15 +02:00
Boris Feld
96e05f8397 configitems: register the 'mq.git' config 2017-06-30 03:43:14 +02:00
Boris Feld
6c523b26e1 configitems: register the 'win32mbcs.encoding' config 2017-06-30 03:45:54 +02:00
Pulkit Goyal
a5baff1381 copytrace: move fast heuristic copytracing algorithm to core
copytrace extension in fb-hgext has a heuristic implementation of copy tracing
which is faster than the current copy tracing. The heuristic limits the search
of copies to just files that are either:

1) Renames in the same directory
2) Moved to other directory with same name

The default copytrace implementation is very slow as it finds all the new files
that were added from merge base up to the head commit and for each file it
checks whether it this was copied or moved version of a different file.

Stash@fb did analysis for the above heuristics on the fb repo and found that
among 2,443,768 moves/copies there are only 32,234 moves/copies which does not
fall under the above heuristics which is approx. 0.013 of total copies.

This patch moves the heuristics algorithm under config
`experimental.copytrace=heuristics`.

While moving fbext to core, this patch removes couple of less useful config
options named `sourcecommitlimit` and `maxmovescandidatestocheck`.

Tests are also added for the heuristics algorithm, which are basically copied
from fbext/tests/test-copytrace.t. The tests follow a pattern creating a server
repo and then cloning to a local repo to create public and draft changesets, the
distinction which will be useful in upcoming patches.

After this patch `experimental.copytrace` has the following behaviour:

1) `off`: turns off copytracing
2) `heuristics`: use the heuristic algorithm added in this patch.
3) everything else: use the full copytracing algorithm

.. feature::

   A new fast heuristic algorithm for copytracing which assumes that the files
   moves are either::
   1) Renames in the same directory
   2) Moves in other directories with same names
   You can use this algorithm by setting `experimental.copytrace=heuristics`.

Differential Revision: https://phab.mercurial-scm.org/D623
2017-09-03 03:49:15 +05:30
Boris Feld
f1a318b57c configitems: register the 'convert.svn.startrev' config 2017-06-30 03:36:46 +02:00
Boris Feld
65dddb9921 configitems: register the 'convert.svn.debugsvnlog' config 2017-06-30 03:36:36 +02:00
Boris Feld
bfd6a094b8 configitems: register the 'convert.skiptags' config 2017-06-30 03:36:28 +02:00
Boris Feld
167f67866c configitems: register the 'convert.p4.startrev' config 2017-06-30 03:36:20 +02:00
Boris Feld
84900c1583 configitems: register the 'convert.localtimezone' config 2017-06-30 03:36:00 +02:00
Boris Feld
cb1096bc89 configitems: register the 'convert.ignoreancestorcheck' config 2017-06-30 03:35:55 +02:00
Boris Feld
1f2741adc0 configitems: register the 'convert.hg.usebranchnames' config 2017-06-30 03:35:48 +02:00
Boris Feld
4b94346048 configitems: register the 'convert.hg.tagsbranch' config 2017-06-30 03:35:38 +02:00
Boris Feld
fc4e98f098 configitems: register the 'convert.hg.startrev' config 2017-06-30 03:35:29 +02:00
Boris Feld
8185f63ed5 configitems: register the 'convert.hg.sourcename' config 2017-06-30 03:35:22 +02:00
Boris Feld
0e74ab2663 configitems: register the 'convert.hg.saverev' config 2017-06-30 03:35:12 +02:00
Boris Feld
4285533e9f configitems: register the 'convert.hg.revs' config 2017-06-30 03:34:58 +02:00
Boris Feld
796bce4006 configitems: register the 'convert.hg.ignoreerrors' config 2017-06-30 03:34:49 +02:00
Boris Feld
5222300c2f configitems: register the 'convert.hg.clonebranches' config 2017-06-30 03:34:45 +02:00
Boris Feld
16cc412230 configitems: register the 'convert.git.skipsubmodules' config 2017-06-30 03:34:32 +02:00
Boris Feld
1d68ca2454 configitems: register the 'convert.git.similarity' config 2017-06-30 03:34:23 +02:00