Commit Graph

20104 Commits

Author SHA1 Message Date
Boris Feld
e0099ff757 phase: generate a push-race detection part on push
We are about to switch phase pushing from using pushkey to using a the new
dedicated binary part. We introduce the push race detection on its own to help
detect potential impact.
2017-10-11 07:40:00 +02:00
Boris Feld
f74c12124e phase: introduce a new 'check:phases' part
This part checks if revisions are still in the same phase as when the
bundle was generated. This is similar to what 'check:heads' or
'check:updated-heads' bundle2 part achieves for changesets.

We needs seems before we can move away from pushkey usage from phase since
pushkey has it own built-in push-race detection.
2017-10-11 07:13:02 +02:00
Boris Feld
68629fa552 phase: gather remote phase information in a summary object
We keep useful phase information around. The data will be reused with detecting
push-race in later changesets.
2017-10-11 18:39:04 +02:00
Boris Feld
048b95b938 phase: simplify the check for issue3781 shortcut in discovery
We'll rework the code around this check. Limiting the entanglement will help
with later changesets
2017-10-11 18:39:34 +02:00
Boris Feld
02117664d7 exchange: fix issue3781 reference in the comment
This comment is about:

  issue3781: Courtesy Phases synchronisation to publishing server prevent
             subrepo push
Not about:

  issue3871: Slow hg log when template contains {file_adds}, {file_mods} and
             {file_dels}
2017-10-16 12:36:42 +02:00
Boris Feld
bf2608127e phase: filter out non-draft item in "draft root"
The on-disk file can contain draft root that are descendants of secret root.
The resulting phase computation is correct, but the phases root content is
not. I will send another series to introduce code that remove some of the
cases where this can happens, but we first need to damage control the existing
case.

After this changeset, we can no longer advertise secret changeset as draft
root.
2017-10-11 20:08:02 +02:00
Matt Harbison
408a3898be subrepo: share instead of clone if the parent repo is shared (issue5675) (BC)
Previously, only the top level repo was shared, and then any subrepos were
cloned on demand.  This is problematic because commits to the parent repo would
write an updated .hgsubstate to the share source, but the corresponding subrepo
commit would be stuck in the local subrepo.  That would prevent an update in the
source repo.  We already go to great lengths to avoid having inconsistent repos
(e.g., `hg push -r rev` will push _everything_ in a subrepo, even if it isn't
referenced in one of the parent's outgoing commits).  Therefore, this seems like
a bug fix, and there's no option to get the old behavior.  I can't imagine the
previous behavior was useful to anybody.

There shouldn't be an issue with svn, since it is centralized.  Maybe --git-dir
can be used for git subrepos, but I'll leave that to someone more familiar with
git.

An integer was previously being implicitly returned from commands.share(), which
caused dispatch() to start crashing when changing over to returning the shared
repo.  All error paths appear to raise, so this can be hardcoded to success.
The clone command checks for 'is None' in a similar pattern, but since
hg.clone() always returns a tuple, that seems wrong?

.. fix:: Issue 5675

   Creating a share of a repository with a Mercurial subrepository will now
   share the subrepository.

and

.. bc::

   Mercurial subrepositories are now shared instead of cloned when the parent
   repository is shared.  This prevents dangling subrepository references in the
   share source.  Previously shared repositories with cloned subrepositories
   will continue to function unchanged.
2017-10-15 22:48:02 -04:00
Augie Fackler
bcaad82b20 webcommands: replace str(ctx) etc with pycompat.bytestr(ctx) etc
hgweb can now serve the graph view in Python 3.

Differential Revision: https://phab.mercurial-scm.org/D1138
2017-10-16 22:51:58 -04:00
Augie Fackler
4c963a0721 templater: don't blow up when trying to build an abort message
__name__ is unicode, but we need bytes. For now, we'll make the
(mostly-safe) assumption that template filter names will be ascii.

Differential Revision: https://phab.mercurial-scm.org/D1137
2017-10-16 22:50:39 -04:00
Augie Fackler
45c9441c0e webutil: use pycompat.bytestr() instead of str()
Stops us from choking the templater on Python 3. With this patch
applied, much of hgweb works correctly in Python 3. The notable
exception is the graph page, which chokes because it gets node IDs as
str instead of bytes.

Differential Revision: https://phab.mercurial-scm.org/D1135
2017-10-16 22:44:06 -04:00
Augie Fackler
c6a33e23e1 hgweb: correct an earlier error of mine - start should be bytes
Gets hgweb very close to working with Python 3.

Differential Revision: https://phab.mercurial-scm.org/D1134
2017-10-16 22:43:19 -04:00
Boris Feld
902027adea config: simplify aliasing commands.update.check
experimental.updatecheck was renamed into commands.update.check, use the
config system to provides the fallback on the old config name instead of
adding more code.

Differential Revision: https://phab.mercurial-scm.org/D1117
2017-10-16 18:58:16 +02:00
Augie Fackler
44f638de23 mpatch: switch alignment of wrapped line from tab to spaces with clang-format
I may be a weird person for liking this style, but our C style is
historically nominally the Linux Kernel style, and when you configure
clang-format to be kernel-ish, this is what you get. If we want to
change it, we can do so by tweaking the formatter rules in the future.

Differential Revision: https://phab.mercurial-scm.org/D1132
2017-10-04 11:00:04 -04:00
Augie Fackler
210a208635 mpatch: reformat function prototypes with clang-format
Differential Revision: https://phab.mercurial-scm.org/D1131
2017-10-04 10:56:33 -04:00
Ryan McElroy
97fa443439 merge: allow user to halt merge on merge-tool failures
Depends on D932.

Call the new _onfilemergefailure function when a merge tool reports failure
via a return code.

Differential Revision: https://phab.mercurial-scm.org/D951
2017-10-06 06:48:43 -07:00
Ryan McElroy
cc72ebf3bc filemerge: introduce functions to halt merge flow
Depends on D931.

This patch introduces functions and a config option that will allow a user
to halt the merge if there are failures during a file merge. These functions
will be used in the next patch.

Differential Revision: https://phab.mercurial-scm.org/D932
2017-10-06 06:48:43 -07:00
Pulkit Goyal
8fe8ec1089 cmdutil: pass metadata from amend() to cleanupnodes
`commit --amend` and amend command in core and extensions rely on
cmdutil.amend() for amending a commit. So the logic to add a note to amend must
reside here. This patch assumes that note will be passed in opts dictionary to
the function and it will be passed to cleanupnodes and then createmarkers to
store the note in the obsmarker metadata.

After this patch, note can be stored on an amend changeset by passing notes as a
part of opts to cmdutil.amend().

Differential Revision: https://phab.mercurial-scm.org/D1094
2017-10-15 15:32:03 +05:30
Pulkit Goyal
66d216220e scmutil: add capability to cleanupnodes to take obsmarker metadata
This patch adds a metadata argument to cleanupnodes() which will be dict and can
be passed to obsmarker.createmarkers() and can be stored on the obsmarker.
In cases when obsolescence is not enabled, the metadata argument is useless.

This is a step towards storing a note in amend.

Differential Revision: https://phab.mercurial-scm.org/D1093
2017-10-15 14:34:24 +05:30
Phil Cohen
a04280b2f9 context: add workingfilectx.markcopied
With in-memory merge, copy information needs to be stored in-memory, not in the
dirstate.

To make this transition easy, move the existing dirstate-based approach to
workingfilectx; that way, other implementations can choose to store it
somewhere else.

Differential Revision: https://phab.mercurial-scm.org/D1106
2017-10-15 20:36:29 -07:00
Phil Cohen
fac2e07a2a merge: don't use workers in in-memory mode
The worker processes can't share memory, so workers should not be used.

Differential Revision: https://phab.mercurial-scm.org/D1105
2017-10-15 20:36:29 -07:00
Phil Cohen
a76f841e4e filemerge: add a missing flushall()
Differential Revision: https://phab.mercurial-scm.org/D1060
2017-10-15 20:36:29 -07:00
Phil Cohen
a93f277c4b filemerge: store backups in the overlayworkingctx if using imm
Differential Revision: https://phab.mercurial-scm.org/D1059
2017-10-13 12:34:22 -07:00
Phil Cohen
220e45c6d6 context: add overlayfilectx.cmp()
Differential Revision: https://phab.mercurial-scm.org/D1058
2017-10-13 12:34:22 -07:00
Phil Cohen
e16963ee65 filemerge: use arbitraryfilectx for backups
With in-memory merge, backup files might be overlayworkingfilectxs stored
in memory. But they could also be real files if the user's backup directory is
outside the working dir.

Rather than have two code paths everywhere, let's use arbitraryfilectx so they
can be consistent.

Differential Revision: https://phab.mercurial-scm.org/D1057
2017-10-16 13:10:55 -07:00
Pulkit Goyal
aaa435b086 registrar: add support for storing the type of command in func object
This patch adds support for storing the type of command which is going to run in
the func object. For this it does the following:

1) Add three possible values as attributes to the registrar.command class
2) Add a new argument to registrar.command._doregister function
3) Add a new attribute cmdtype to the func object

The type of command will be helpful in deciding what level of access on hidden
commits it can has.

Differential Revision: https://phab.mercurial-scm.org/D736
2017-09-20 04:47:43 +05:30
Boris Feld
9d80c5624f configitems: register the 'hostsecurity.*:verifycertsfile' config 2017-10-14 00:30:14 +02:00
Boris Feld
2c9df67473 configitems: register the 'hostsecurity.*:fingerprints' config 2017-10-14 00:29:31 +02:00
Boris Feld
3411c59c2f configitems: register the 'hostsecurity.*:ciphers' config 2017-10-14 00:28:48 +02:00
Boris Feld
a087914d79 configitems: register the 'hostsecurity.*:minimumprotocol' config 2017-10-14 00:28:13 +02:00
Boris Feld
c8ced9d060 configitems: register the 'extdata' section 2017-10-13 23:23:48 +02:00
Boris Feld
967247e8ec configitems: fix registration of extensions config
The new 'itemregister' class should be used when loading the extension config.
This was and oversight when itemregister was introduced.
2017-10-13 23:33:31 +02:00
Boris Feld
4c94a47479 configitems: register the 'web.staticurl' config 2017-10-13 23:03:46 +02:00
Boris Feld
14093a3043 configitems: register the 'hgweb-paths' section 2017-10-12 00:44:45 +02:00
Boris Feld
eeada116f6 configitems: register the 'hostfingerprints' section 2017-10-12 00:20:41 +02:00
Boris Feld
a345bd5d76 configitems: register the 'hostsecurity.minimumprotocol' config 2017-10-12 00:19:12 +02:00
Boris Feld
cb6b7ec15b configitems: register the 'progress.format' config 2017-10-11 22:53:17 +02:00
Augie Fackler
27aba6c982 hgweb: fix decodevaluefromheaders to always return a bytes value
That's more in line with what we want, and we know it's ASCII data
since that's all HTTP technically allows in headers anyway.

Differential Revision: https://phab.mercurial-scm.org/D1112
2017-10-15 00:43:01 -04:00
Augie Fackler
386ad003ae hgweb: more "headers are native strs" cleanup
I'll fix the decodevaluefromheaders function in an upcoming change.

Differential Revision: https://phab.mercurial-scm.org/D1111
2017-10-15 00:42:25 -04:00
Augie Fackler
db6ecaafd2 hgweb: when unpacking args from request form, convert to bytes
We assume http-originated values are ASCII, which should be safe based
on the RFC.

Differential Revision: https://phab.mercurial-scm.org/D1110
2017-10-15 00:41:34 -04:00
Augie Fackler
4b3002a912 wireproto: more strkwargs cleanup
Differential Revision: https://phab.mercurial-scm.org/D1109
2017-10-15 00:39:53 -04:00
Augie Fackler
22c84078c4 hgweb: more "http headers are native strs" cleanup
Differential Revision: https://phab.mercurial-scm.org/D1108
2017-10-15 00:38:33 -04:00
Augie Fackler
4fa42c83ce wireproto: bounce kwargs to/from bytes/str as needed
Differential Revision: https://phab.mercurial-scm.org/D1107
2017-10-15 00:05:43 -04:00
Boris Feld
5068121d4c configitems: fixup default value of annotate config option
It turned out that configbool is used for most of them so the registered
default value was wrong.
2017-10-16 15:12:50 +02:00
Denis Laxalde
ff300063f3 transaction-summary: use a revset to filter obsoletes in reportnewcs()
Thanks to Yuya Nishihara for suggesting.
2017-10-16 15:35:08 +02:00
Boris Feld
834dcb3800 configitems: fixup default value of diff config option
It turned out that configbool is used for most of them so the registered
default value was wrong.
2017-10-13 22:08:55 +02:00
Boris Feld
2253c06027 devel-warn: add 'warn-' to 'devel.empty-changegroup' config
Rename 'devel.empty-changegroup' to 'devel.warn-empty- changegroup' in order
to clarify it controls a warning message.

No alias is installed since the previous configuration option was not
documented.
2017-10-08 21:42:32 +02:00
Augie Fackler
25449b9adb peer: ensure command names are always ascii bytestrs
Differential Revision: https://phab.mercurial-scm.org/D1104
2017-10-15 00:05:00 -04:00
Augie Fackler
aff2a14d65 httppeer: always produce native str header keys and values
Differential Revision: https://phab.mercurial-scm.org/D1103
2017-10-15 00:03:31 -04:00
Augie Fackler
f4a2677719 wireproto: use %d to encode int, not %s
Differential Revision: https://phab.mercurial-scm.org/D1102
2017-10-15 00:40:07 -04:00
Augie Fackler
29944e3fdf wireproto: use a proper exception instead of assert False
Differential Revision: https://phab.mercurial-scm.org/D1101
2017-10-15 00:06:06 -04:00
Augie Fackler
7914273147 wireproto: use listcomp instead of map()
The latter returns a generator object on Python 3, which breaks
various parts of hg that expected a list.

Differential Revision: https://phab.mercurial-scm.org/D1100
2017-10-15 00:39:29 -04:00
Augie Fackler
e90604cb5e dagutil: use a listcomp instead of a map()
In Python 3, the map() returns a generator object instead of a list,
and some parts of hg depend on this being consumable more than once or
sortable in place.

Differential Revision: https://phab.mercurial-scm.org/D1099
2017-10-15 00:37:24 -04:00
Augie Fackler
510310c11a peer: when collecting method names for batch calls, bytes-ify __name__
This will explode violently if we have a non-ascii command name. That
shouldn't ever happen in core, and seems unlikely even in third-party
code. Regardless, it'll explode violently, so we can revisit things in
the future if we need to change the encoding here.

Differential Revision: https://phab.mercurial-scm.org/D1092
2017-10-14 12:03:42 -04:00
Augie Fackler
6509db2306 python3: replace im_{self,func} with __{self,func}__ globally
These new names are portable back to Python 2.6.

Differential Revision: https://phab.mercurial-scm.org/D1091
2017-10-14 12:02:15 -04:00
Augie Fackler
e5d72894dc httppeer: extract content-type from headers using native str
Differential Revision: https://phab.mercurial-scm.org/D1090
2017-10-14 12:00:35 -04:00
Augie Fackler
74dcc6aa29 httppeer: convert request url back to bytes before inspecting it
Differential Revision: https://phab.mercurial-scm.org/D1089
2017-10-14 11:59:51 -04:00
Augie Fackler
ffc31606d6 templater: explode if we try to emit a str
Without this if branch, we infinitely recurse in _flatten, which is
very confusing. Something in an hgweb template is trying to write out
a string instead of a bytes on Python 3, and this at least makes it
crash politely.

Differential Revision: https://phab.mercurial-scm.org/D1088
2017-10-14 11:30:17 -04:00
Augie Fackler
1eb0868158 hgweb: fill in content-type and content-length as native strings
This lets me actually get a capabilities response from hgweb over
http.

Differential Revision: https://phab.mercurial-scm.org/D1087
2017-10-14 11:20:31 -04:00
Augie Fackler
d3a0083e45 hgweb: mimetype guessing needs a unicode path
Differential Revision: https://phab.mercurial-scm.org/D1086
2017-10-14 10:47:29 -04:00
Augie Fackler
dfaf4b98bc hgweb: set sent_headers attr as early as practical
While doing Python 3 porting work, I've seen exceptions happen in
parts of hgweb we normally assume are robust. It won't hurt anything
to set this attribute significantly earlier, so let's do so and save
confusing during the porting process.

Differential Revision: https://phab.mercurial-scm.org/D1085
2017-10-14 15:37:33 -04:00
Augie Fackler
caec472139 hgweb: detect Python 3-era libraries and use modern attribute names
Differential Revision: https://phab.mercurial-scm.org/D1084
2017-10-05 14:53:52 -04:00
Augie Fackler
1f7e395752 server: indent block that's about to get conditionalized
Differential Revision: https://phab.mercurial-scm.org/D1083
2017-10-14 15:53:36 -04:00
Yuya Nishihara
62122f42ea templates: fix missed space between instability labels 2017-10-14 18:41:20 +09:00
Yuya Nishihara
0e862d288f templates: introduce labelcset() function in map-cmdline.default as example 2017-10-14 18:24:01 +09:00
Yuya Nishihara
550442a9eb templater: load aliases from [templatealias] section in map file
This seems sometimes useful as an alias can be a function, but a template
fragment can't.
2017-10-14 18:06:42 +09:00
Yuya Nishihara
994c332a3b templater: load template fragments from [templates] section in map file
This allows us to %include map-cmdline.<style> file in our .hgrc files. The
syntax is slightly different as hgrc doesn't support loading an external
template file, but map-cmdline files don't use this feature, so the syntax
can be considered identical in practice.

Unnamed section is remapped for backward compatibility.
2017-10-14 17:51:01 +09:00
Yuya Nishihara
615ab8c775 config: allow remapping the default section
The next patch depends on it. It doesn't make sense that the default section
can't be remapped with {'': whatever}.
2017-10-14 17:41:41 +09:00
Yuya Nishihara
e2e58c1839 templater: simplify merge of __base__ dicts by reading it first 2016-08-20 18:33:02 +09:00
Boris Feld
3905794a8c phase: add a dedicated pretxnclose-phase hook
This new hook mirror the newly introduced 'txnclose-phase' but can abort the
transaction.
2017-10-08 17:23:18 +02:00
Boris Feld
5dfba786e8 phase: add a dedicated txnclose-phase hook
The new 'txnclose-phase' hook expose the phase movement information stored in
'tr.changes['phases]'. To provide a simple and straightforward hook API to the
users, we introduce a new hook called for each revision affected.  Since a
transaction can affect the phase of multiple changesets, updating the existing
'txnclose' hook to expose that information would be more complex. The data for
all moves will not fit in environment variables and iterations over each move
would be cumbersome. So the introduction of a new dedicated hook is
preferred in this changesets.

This does not exclude the addition of the full phase movement information to
the existing 'txnclose' in the future to help write more complex hooks.
2017-10-08 17:50:46 +02:00
Boris Feld
db2e8fadae bookmark: add a dedicated pretxnclose-bookmark hook
This new hook mirror the newly introduced 'txnclose-bookmark' but can abort the
transaction.
2017-10-08 18:50:14 +02:00
Boris Feld
4815e3ce8d bookmark: add a dedicated txnclose-bookmark hook
The new 'txnclose-bookmark' hook expose the bookmark movement information
stored in 'tr.changes['bookmarks]'. To provide a simple and straightforward
hook API to the users, we introduce a new hook called for each bookmark
touched. Since a transaction can affect multiple bookmarks, updating the
existing 'txnclose' hook to expose that information would be more complex. The
data for all moves might not fit in environment variables and iterations over
each move would be cumbersome. So the introduction of a new dedicated hook is
preferred in this changeset.

This does not exclude the addition to the full bookmark information to the
existing 'txnclose' in the future to help write more complex hooks.
2017-10-10 17:53:42 +02:00
Augie Fackler
83f88ecb85 tweakdefaults: make commands.update.check be noconflict
This is the second-safest option we have to offer in `updatecheck`,
with `abort` being the safest and `linear` being the default. At the
sprint we discussed how much `none` and `linear` make us all
uncomfortable, and how we'd like to move the default behavior if we can.

I'm not sure we can get away with actually changing the out of the box
default behavior, but we can at *least* do this.

Differential Revision: https://phab.mercurial-scm.org/D1062
2017-10-13 15:58:54 -04:00
Augie Fackler
bc69639184 hgweb: fix logging to use native strings as appropriate
Kind of a tangled mess, but now logging works in both Python 2 and 3.

# no-check-commit because of the interface required by Python's HTTP
server code.

Differential Revision: https://phab.mercurial-scm.org/D1080
2017-10-14 15:43:06 -04:00
Augie Fackler
2fea5f41d1 config: graduate experimental.updatecheck to commands.update.check
.. feature::

  New `commands.update.check` feature to adjust constraints on when
  `hg update` will allow updates with a dirty working copy.

also

.. bc::

    The `experimental.updatecheck` name for the new `commands.update.check`
    feature is now deprecated, and will be removed after this release.

Differential Revision: https://phab.mercurial-scm.org/D1070
2017-10-14 03:13:50 -04:00
Augie Fackler
3327fe780e hgweb: rewrite most obviously-native-strings to be native strings
This clearly won't be everything, but it unblocks a fair amount of
stuff here.

Differential Revision: https://phab.mercurial-scm.org/D1079
2017-10-14 15:42:38 -04:00
Augie Fackler
9f097cd648 hgweb: use native strings consistently for querystring parsing
Differential Revision: https://phab.mercurial-scm.org/D1078
2017-10-05 14:48:52 -04:00
Augie Fackler
4fec03fc61 hgweb: rewrite two X or Y and Z ad-hoc ternaries with Y if X else Z
Just easier to muddle through for my brain now that I don't see the
old pattern much anymore.

Differential Revision: https://phab.mercurial-scm.org/D1077
2017-10-05 14:48:31 -04:00
Augie Fackler
14c0f38685 httppeer: use native strings for headers
On Python 3, we need to use unicodes, rather than bytes. This lets
test-pull.t get a lot further along.

Differential Revision: https://phab.mercurial-scm.org/D887
2017-10-01 12:12:34 -04:00
Augie Fackler
58adac28f6 hgweb: more native string treatment in query string parsing
Differential Revision: https://phab.mercurial-scm.org/D1076
2017-10-05 14:29:51 -04:00
Augie Fackler
97ea947740 httppeer: pass url to urllib as native str, not bytes
Differential Revision: https://phab.mercurial-scm.org/D1075
2017-10-14 14:07:39 -04:00
Denis Laxalde
6c2c086e11 tersestatus: rework dirnode and tersedir docstrings
Follow-up on refactorings 6a96abee0045 and b8c13fc92233 of the original
changeset 8c58ee1e5fa4 by updating the docstrings of dirnode class and tersedir
function:

* rewrite dirnode.iterfilepaths()'s docstring (the method got
  renamed and reimplemented in b8c13fc92233);
* simplify and update dirnode.tersewalk() to remove reference to 'self' and
  'tersedict';
* use the imperative form of verbs in the first sentence of all docstrings.

Differential Revision: https://phab.mercurial-scm.org/D1072
2017-10-14 13:33:37 +02:00
Augie Fackler
714a44cc5e bitmanipulation: reformat with clang-format
Mostly un-wrapping over-wrapped definitions.

Differential Revision: https://phab.mercurial-scm.org/D1069
2017-10-04 10:52:50 -04:00
Augie Fackler
a67386352a python3: use our bytes-only version of cgi.escape everywhere
As suggested by Yuya in D965.

Differential Revision: https://phab.mercurial-scm.org/D1067
2017-10-05 14:16:20 -04:00
Augie Fackler
5167a44c70 url: add cgi.escape equivalent for bytestrings
This seems like a sensible enough place to put it.

Differential Revision: https://phab.mercurial-scm.org/D1066
2017-10-14 02:57:26 -04:00
Augie Fackler
a4bc1fe43c python3: move from using func_name to __name__
Previously reviewed as D964, but required some fixups and therefore
seems to need a new revision.

Differential Revision: https://phab.mercurial-scm.org/D1065
2017-10-05 14:15:05 -04:00
Boris Feld
00846dabc6 hook: add a 'hashook' function to test for hook existence
Preparing the data for some hooks can be expensive. Add a function to check if
a hook exists so we can skip useless preparation if no hook is configured.
2017-10-08 13:08:31 +02:00
Phil Cohen
0d0a416a27 context: add a fast-comparision for arbitraryfilectx and workingfilectx
Differential Revision: https://phab.mercurial-scm.org/D1056
2017-10-13 12:40:05 -07:00
Denis Laxalde
6ff583b949 tersestatus: avoid modifying tersedict
Turn dirnode's methods into generators which can be used to update "tersedict"
in caller. So instead of passing the "tersedict" to be mutated here and there,
it's now clearer where it is updated as it's purely a local variable to
tersedir() function.

While I was here, I renamed _processtersestatus to tersewalk and
_addfilestotersed to iterfilepaths.

Differential Revision: https://phab.mercurial-scm.org/D1043
2017-10-13 04:02:06 +05:30
Denis Laxalde
e623051ee4 tersestatus: make methods part of the dirnode class
Differential Revision: https://phab.mercurial-scm.org/D1042
2017-10-11 21:19:19 +02:00
Pulkit Goyal
4b9eb4d057 tersestatus: re-implement the functionality to terse the status
The previous terse status implementation was hacking around os.listdir() and was
flaky. There have been a lot of instances of mercurial buildbots failing
and google's internal builds failing because of the
hacky implementation of terse status. Even though I wrote the last
implementation but it was hard for me to find the reason for the flake.

The new implementation can be slower than the old one but is clean and easy to
understand.

In this we create a node object for each directory and create a tree
like structure starting from the root of the working copy. While building the
tree like structure we store some information on the nodes which will be helpful
for deciding later whether we can terse the dir or not.
Once the whole tree is build we traverse and built the list of files for each
status with required tersing.

There is no behaviour change as the old test, test-status-terse.t passes with
the new implementation.

Differential Revision: https://phab.mercurial-scm.org/D985
2017-10-06 20:54:23 +05:30
Phil Cohen
b6042b5881 context: add is isinmemory() to filectx
This will make it easier to skip certain behavior when running an in-memory
merge.

Differential Revision: https://phab.mercurial-scm.org/D1061
2017-10-13 12:54:46 -07:00
Ryan McElroy
25aff2d866 merge: ensure that we always commit the mergestate
In future patches, we may halt the merge process based on configuration or
user requests by raising exceptions. We need to ensure that the mergestate
is unconditionally committed even when such an exception is raised.

Depends on D930.

Differential Revision: https://phab.mercurial-scm.org/D931
2017-10-06 06:48:43 -07:00
Durham Goode
1d4b04170c dirstate: move the _dirfoldmap to dirstatemap
Now that dirstatemap is the source of truth for the list of directories, let's
move _dirfoldmap on to it.

This pattern of moving cached variables onto the dirstate map makes it easier to
invalidate them, as seen by how the cache invalidation functions are slowly
shrinking to just be recreating the dirstatemap instance.

Differential Revision: https://phab.mercurial-scm.org/D983
2017-10-05 11:34:41 -07:00
Durham Goode
e37fd6649b dirstate: remove _dirs property cache
Now that dirs is source of truthed on the dirstatemap, let's get rid of the
_dirs propertycache on the dirstate.

Differential Revision: https://phab.mercurial-scm.org/D982
2017-10-05 11:34:41 -07:00
Durham Goode
1b9b3caa47 dirstate: remove _filefoldmap property cache
Now that the filefoldmap is source of truthed on the dirstatemap, let's get rid
of the property cache on the dirstate.

Differential Revision: https://phab.mercurial-scm.org/D981
2017-10-05 11:34:41 -07:00
Durham Goode
28f48a6846 dirstate: move identity to dirstatemap
Moving the identity function to the dirstatemap class will allow alternative
dirstate implementations to replace the implementation.

Differential Revision: https://phab.mercurial-scm.org/D980
2017-10-05 11:34:41 -07:00
Durham Goode
f97f617524 dirstate: move nonnormal and otherparent sets to dirstatemap
As part of separating dirstate business logic from storage, let's move the
nonnormal and otherparent storage to the dirstatemap class. This will allow
alternative dirstate storage to persist these sets instead of recomputing them.

Differential Revision: https://phab.mercurial-scm.org/D979
2017-10-05 11:34:41 -07:00
Durham Goode
99779c0bbb dirstate: move write into dirstatemap
As part of separating the dirstate business logic from the dirstate storage
logic, let's move the serialization code down into dirstatemap.

Differential Revision: https://phab.mercurial-scm.org/D978
2017-10-05 11:34:41 -07:00
Durham Goode
76bcc9b3be dirstate: move _read into dirstatemap
As part of separating the dirstate business logic from the storage, let's move
the read code into the new dirstatemap class.

Differential Revision: https://phab.mercurial-scm.org/D977
2017-10-05 11:34:41 -07:00
Boris Feld
7fa654bef2 configitems: register the 'templates' section 2017-10-08 21:29:24 +02:00
Boris Feld
1dca7c7296 configitems: register the 'paths' config section 2017-10-11 05:01:55 +02:00
Boris Feld
2ea04ee5d5 configitems: register the 'pager.attend-.*' options 2017-10-11 02:26:09 +02:00
Boris Feld
9296910ea4 configitems: register the 'hooks' config section 2017-10-13 16:39:06 +02:00
Boris Feld
0748d57ee7 configitems: register the 'extensions' section 2017-10-10 10:48:47 +02:00
Boris Feld
90436ba7a8 configitems: register the 'defaults' section 2017-10-08 20:39:51 +02:00
Boris Feld
04cc694185 configitems: register the 'committemplate' section 2017-10-08 21:02:02 +02:00
Boris Feld
abe633ebaf configitems: register the 'color' section 2017-10-10 10:49:28 +02:00
Boris Feld
101b5cf034 configitems: register the 'alias' section 2017-10-08 20:26:25 +02:00
Boris Feld
f9a854f7cf configitems: allow for the registration of "generic" config item
Some section can contains arbitrary keys (eg: color, alias, extensions). We
add a way to register some generic config items for them. This is necessary to
get all the config registered. We use a regular expression because some sub-
attributes (eg: hooks.xxx.priority) can define default value on their own.
2017-10-10 10:49:15 +02:00
Denis Laxalde
9efc7f05e3 transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Upon pull or unbundle, we display a message with the range of new revisions
fetched. This revision range could readily be used after a pull to look out
what's new with 'hg log'. The algorithm takes care of filtering "obsolete"
revisions that might be present in transaction's "changes" but should not be
displayed to the end user.
2017-10-12 09:39:50 +02:00
Yuya Nishihara
1b540c162d i18n: cache translated messages per encoding
This is a simpler workaround alternative to D958, "i18n: clean msgcache when
encoding changes." The cache won't be bloated unless you run tons of commands
with different --encoding options on command server, or serve many repositories
of different web.encoding options on hgweb.

The test was originally written by Jun Wu.

Differential Revision: https://phab.mercurial-scm.org/D1053
2017-10-13 21:36:10 +09:00
Yuya Nishihara
239bc0e96c templater: fix ifcontains() to handle type mismatch gracefully
This was unintentionally changed in b8023e389b64. Since ifcontains() takes
needle of any types, it shouldn't abort depending on the given container type.
2017-10-12 22:09:11 +09:00
Yuya Nishihara
11659330ed help: use single quotes in `template example`
It was hard to read because ``""`` was rendered as """".
2017-10-12 21:56:13 +09:00
Yuya Nishihara
b3bcc5233c help: hide template keywords of obsolescence as they are still experimental 2017-10-12 21:48:02 +09:00
Yuya Nishihara
c9014c6361 help: fix formatting of template keywords
Our minirst formatter can't render multi-paragraph definition lists well.
Also added periods where appropriate.
2017-10-12 21:42:42 +09:00
Yuya Nishihara
a312ee40fa configitems: drop redundant default of web.allow<archtype>
Otherwise develwarn would be sent to stderr. I've added blackbox logging
to capture warnings.
2017-10-13 00:22:54 +09:00
Yuya Nishihara
607219189c configitems: correct default values of web.allow<archtype> and web.hidden
The default of ui.configbool() is False unless explicitly specified.
2017-10-13 00:14:28 +09:00
Yuya Nishihara
1f85a4e152 bdiff: include compat.h in header to define ssize_t
Before cb121eb76276, compat.h was included first so it happened to work.
But we shouldn't rely on the include order.
2017-10-13 22:38:24 +09:00
Pulkit Goyal
9492c3a9ec repoview: remove incorrect documentation of the function
In repoview.py, computeunserved() and computemutable() functions had the same
documentation. The documentation of computemutable() is wrong. I was unable to
write documentation for the function but it's better to not having the
documentation than having it wrong.

Differential Revision: https://phab.mercurial-scm.org/D1016
2017-10-10 23:19:35 +05:30
Jun Wu
79d026fdfe codemod: use pycompat.isdarwin
This is done by:

  sed -i "s/pycompat\.sysplatform == 'darwin'/pycompat.isdarwin/" **/*.py

Plus a manual change to `sslutil.py` which involves indentation change that
cannot be done by `sed`.

Differential Revision: https://phab.mercurial-scm.org/D1035
2017-10-12 23:34:34 -07:00
Jun Wu
72d17900ca codemod: use pycompat.isposix
This is done by:

  sed -i "s/pycompat\.osname == 'posix'/pycompat.isposix/" **/*.py

Differential Revision: https://phab.mercurial-scm.org/D1036
2017-10-12 09:04:22 -07:00
Jun Wu
2ae56b14de codemod: use pycompat.iswindows
This is done by:

  sed -i "s/pycompat\.osname == 'nt'/pycompat.iswindows/" **/*.py
  sed -i "s/pycompat\.osname != 'nt'/not pycompat.iswindows/" **/*.py
  sed -i 's/pycompat.osname == "nt"/pycompat.iswindows/' **/*.py

Differential Revision: https://phab.mercurial-scm.org/D1034
2017-10-12 23:30:46 -07:00
Jun Wu
7b62930cd9 pycompat: define operating system constants
As suggested by Ryan in D1019, it's cleaner if we use defined constants
instead of `osname == 'nt'` everywhere.

Differential Revision: https://phab.mercurial-scm.org/D1033
2017-10-12 19:20:04 -07:00
Jun Wu
d91707e2a4 hgweb: do not import uuid immediately to avoid its side effect
With hgdemandimport disabled (chg's case), `import uuid` has an immediate
side effect calling `ctypes.util.find_library` trying to locate the
`libuuid` library.  This happens at `import` time before `dispatch.run()`.
The call trace is like:

  File "hg/hg", line 54, in <module>
    from mercurial import (
  File "hg/mercurial/dispatch.py", line 24, in <module>
    from . import (
  File "hg/mercurial/commands.py", line 23, in <module>
    from . import (
  File "hg/mercurial/help.py", line 33, in <module>
    from .hgweb import (
  File "hg/mercurial/hgweb/__init__.py", line 20, in <module>
    from . import (
  File "hg/mercurial/hgweb/hgweb_mod.py", line 14, in <module>
    from .common import (
  File "hg/mercurial/hgweb/common.py", line 15, in <module>
    import uuid
  File "/usr/lib64/python2.7/uuid.py", line 404, in <module>
    lib = ctypes.CDLL(ctypes.util.find_library(libname))

The problem is, `ctypes.util.find_library` will execute
`sh -c '/sbin/ldconfig -p 2>/dev/null'` on Python <= 2.7.12. The output of
`sh` may pollute the terminal:

  shell-init: error retrieving current directory: getcwd: cannot access
  parent directories: No such file or directory

This patch moves `import uuid` so its side-effect can only happen after the
cwd check in `dispatch._getlocal`. Therefore the terminal won't be
polluted by importing `uuid`.

Differential Revision: https://phab.mercurial-scm.org/D1024
2017-10-11 21:24:32 -07:00
Jun Wu
7f6381a6d9 selectors2: do not use platform.system()
`platform.system()` may have a side effect spawning a shell executing
`uname -p`, which may print a warning when the current directory is removed:

  shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

This patch changes selectors2 to test the `sys.platform` string, which is a
much safer way to detect Jython.

Jython's `sys.platform` looks like this:

  Jython 2.7.1 (default:0df7adb1b397, Jun 30 2017, 19:02:43)
  [OpenJDK 64-Bit Server VM (Oracle Corporation)] on java1.8.0_144
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import sys
  >>> sys.platform
  'java1.8.0_144 ( ==linux2 for targets )'

Differential Revision: https://phab.mercurial-scm.org/D1018
2017-10-11 17:27:21 -07:00
Jun Wu
c0f8669061 dispatch: when --pager=no is passed, also disable pager on req.repo.ui
With a future chg change, `req.repo` could be set and currently it is
unaffected by `--pager=on`. This patch makes it so.

This could make one of the test cases in `test-pager.t` pass with future chg
changes.

Differential Revision: https://phab.mercurial-scm.org/D990
2017-10-09 12:42:28 -07:00
Durham Goode
c48caf9e03 bundle2: immediate exit for ctrl+c (issue5692)
21c2df59a regressed bundle2 by catching all exceptions and trying to handle
them. The old behavior was to allow KeyboardInterrupts to throw and not have
graceful cleanup, which allowed it to exit immediately. Let's go back to that
behavior.

Differential Revision: https://phab.mercurial-scm.org/D960
2017-10-11 10:36:59 -07:00
Augie Fackler
fb50ec8285 exewrapper: format with clang-format
A few *s move around, some spaces around parens, a couple of
braces. Nothing remarkable.

Differential Revision: https://phab.mercurial-scm.org/D1032
2017-10-04 11:04:18 -04:00
Augie Fackler
bad97ff7fe util: add clang-format control comment around struct and format macro
clang-format is not a fan of PyObject_HEAD.

Differential Revision: https://phab.mercurial-scm.org/D1031
2017-10-04 11:02:44 -04:00
Augie Fackler
f4d56c2a16 mpatch: reflow two oddly formatted else blocks with clang-format
Differential Revision: https://phab.mercurial-scm.org/D1029
2017-10-04 10:57:23 -04:00
Augie Fackler
0455ba8dfd mpatch: re-wrap wide line with clang-format
Differential Revision: https://phab.mercurial-scm.org/D1027
2017-10-04 10:55:51 -04:00
Augie Fackler
186610a84b bdiff: remove trailing newlines
Differential Revision: https://phab.mercurial-scm.org/D1009
2017-10-04 10:51:39 -04:00
Augie Fackler
22f768930e bdiff: rewrap function prototypes per clang-format
Differential Revision: https://phab.mercurial-scm.org/D1008
2017-10-04 10:51:25 -04:00
Augie Fackler
137e46c3ae bdiff: re-wrap lines per clang-format
A few too-wide lines corrected, and some places where clang-format
prefers to wrap after the binary operator instead of before. I don't
feel strongly, so I'm leaving the auto-format result as "after the
binary operator".

Differential Revision: https://phab.mercurial-scm.org/D1007
2017-10-04 10:50:54 -04:00
Augie Fackler
49e9563e2f bdiff: remove extra space after * per clang-format
Differential Revision: https://phab.mercurial-scm.org/D1006
2017-10-04 10:49:34 -04:00
Augie Fackler
2163c58549 bdiff: fix misplaced comma in macro definition with clang-format
Differential Revision: https://phab.mercurial-scm.org/D1005
2017-10-04 10:48:46 -04:00
Augie Fackler
663aee0a1f bdiff: format header file with clang-format
Differential Revision: https://phab.mercurial-scm.org/D1004
2017-10-04 10:47:51 -04:00
Augie Fackler
834627e694 bdiff: sort includes using clang-format
Differential Revision: https://phab.mercurial-scm.org/D1003
2017-10-04 10:47:19 -04:00
Denis Laxalde
2964e634ed scmutil: factor out building of transaction summary callback
In registersummarycallback(), we extra generic bits of the existing
"reportsummary" function into a decorator which will be used in forthcoming
changesets to add new summary callbacks.
2017-10-04 18:49:09 +02:00
Denis Laxalde
df0f57f316 scmutil: factor out transaction name lookup in registersummarycallback()
Add an inner txmatch function in registersummarycallback() factoring out the
logic to determine if the transaction matches a particular sources set. We'll
reuse this function to add some new report logic in the new changeset.
2017-10-01 09:52:44 +02:00
Boris Feld
9ab1fae2b8 configitems: register the annotate diff options 2017-10-11 05:23:45 +02:00
Boris Feld
cfd170bf5c configitems: register the 'ui.interface.chunkselector' config 2017-10-11 05:36:10 +02:00
Boris Feld
b09f40c232 configitems: register the 'experimental.archivemetatemplate' config 2017-10-11 05:18:20 +02:00
Boris Feld
bea8fba132 configitems: register the 'server.bundle*' family of config
All these config use the same function specifying a default value. We need to
register them all at the same time.
2017-10-11 17:51:40 +02:00
Boris Feld
baa18d572d configitems: register the 'web.logourl' config 2017-10-11 04:16:17 +02:00
Boris Feld
8209e13aaa configitems: register the 'web.logoimg' config 2017-10-11 04:16:05 +02:00
Boris Feld
783ea5f54c configitems: register the 'web.labels' config 2017-10-11 04:15:48 +02:00
Boris Feld
da25127b96 configitems: register the 'web.hidden' config 2017-10-11 04:15:37 +02:00
Boris Feld
34bf70b86f configitems: register the 'web.guessmime' config 2017-10-11 04:15:24 +02:00
Boris Feld
c8a7ed3681 configitems: register the 'web.deny_push' config 2017-10-11 04:15:08 +02:00
Boris Feld
4be8c3b528 configitems: register the 'web.contact' config 2017-10-11 04:14:44 +02:00
Boris Feld
c71a63f860 configitems: register the 'web.cache' config 2017-10-11 04:14:33 +02:00
Boris Feld
4d84c5f2d5 configitems: register the 'web.allowzip' config 2017-10-11 04:14:14 +02:00
Boris Feld
088bf5e857 configitems: register the 'web.allow_push' config 2017-10-11 04:14:01 +02:00
Boris Feld
e45e1468d5 configitems: register the 'web.allowpull' config 2017-10-11 04:12:50 +02:00
Boris Feld
dc941fd5a9 configitems: register the 'web.allowgz' config 2017-10-11 04:12:34 +02:00
Boris Feld
0af5173fc6 configitems: register the 'web.allowbz2' config 2017-10-11 04:12:23 +02:00
Boris Feld
ff16b03815 configitems: register the 'email.reply-to' config 2017-10-11 03:54:19 +02:00
Boris Feld
74f545a616 configitems: register the 'email.cc' config 2017-10-11 03:54:05 +02:00
Boris Feld
bffa794209 configitems: register the 'email.bcc' config 2017-10-11 03:53:58 +02:00
Boris Feld
502053e485 configitems: register the 'logtoprocess.uiblocked' config 2017-10-11 03:50:24 +02:00
Boris Feld
185e06d7c6 configitems: register the 'logtoprocess.develwarn' config 2017-10-11 03:50:14 +02:00
Boris Feld
6de7bd7a6d configitems: register the 'logtoprocess.command' config 2017-10-11 03:49:47 +02:00
Boris Feld
c6d40db127 configitems: register the 'logtoprocess.commandfinish' config 2017-10-11 03:49:21 +02:00
Boris Feld
d9578ea92a configitems: register the 'logtoprocess.commandexception' config 2017-10-11 03:49:04 +02:00
Boris Feld
cdcf29ac77 configitems: register the 'pager.pager' config 2017-10-11 03:45:14 +02:00
Boris Feld
64308038dd configitems: register the 'web.maxchanges' config 2017-10-11 03:41:48 +02:00
Boris Feld
308fd61d70 configitems: register the 'web.maxfiles' config 2017-10-11 03:41:01 +02:00
Boris Feld
6ea0289f11 configitems: register the 'web.maxshortchanges' config 2017-10-11 03:39:21 +02:00
Boris Feld
5c68cc40ee configitems: register the 'web.motd' config 2017-10-11 03:36:44 +02:00
Boris Feld
78e86af2e6 configitems: register the 'web.name' config 2017-10-11 03:32:59 +02:00
Boris Feld
176f52eb1f configitems: register the 'web.push_ssl' config 2017-10-11 03:29:09 +02:00
Boris Feld
abce33cdad configitems: register the 'web.view' config 2017-10-11 03:18:04 +02:00
Kevin Bullock
ec53973300 status: copy-edit and improve --terse and --verbose help 2017-10-10 10:27:35 -05:00
Yuya Nishihara
6cc1150344 templater: store revisions as ints so min/max won't compare them as strings
Because a template value has no explicit type (like ancient PHP), ifcontains()
has to coerce the type of the needle. Before, it was always converted to a
string, which meant any container type should be a list/dict of strings.
This no longer works since we've introduced min/max functions.

In order to work around the untyped nature of templater, this patch adds
a type specifier to hybrid dict/list. It isn't named as "valuetype" since
the _hybrid class can also wrap a dict.
2017-09-19 23:13:46 +09:00
Boris Feld
9c89c78d23 obsolete: add a devel.user.obsmarker
In tests, we often want to use a different username in obs-markers without
changing the default user. Add a 'devel.user.obsmarker'.
2017-10-06 16:15:24 +02:00
Augie Fackler
3835de40d8 ui: recommend tweakdefaults in the default hgrc template
Were I only slightly bolder, I'd make it on by default in the
suggested user hgrc.

Differential Revision: https://phab.mercurial-scm.org/D1001
2017-10-11 01:56:49 -07:00
Jun Wu
0ca89d02a2 patch: do not cache translated messages (API)
Previously the code caches `i18n._` results in module variables. That causes
issues after an encoding change. Instead of invalidating them manually, we
now just recalculate the translated messages every time `filterpatch` gets
called.

This makes test-commit-interactive.t pass regardless of whether chg or
demandimport is used or not.

.. api: `patch.messages` now lives in `patch.getmessages()`.

   Extensions adding new messages should now wrap the `patch.getmessages`
   method instead of changing `patch.messages` directly.

Differential Revision: https://phab.mercurial-scm.org/D959
2017-10-05 13:38:48 -07:00
Boris Feld
7cddd5a606 configitems: update default value of 'phases.new-commit'
Now that mq is cleaned up, we can rely on the config register for the default
value. We switch the default from the integer to human readable value to help
with future automatic documentation that could be generated from the config
register.
2017-10-09 16:31:43 +02:00
Denis Laxalde
5b704efceb patch: rename "header" variable into "hdr" in diff()
The "header" variable was hiding the eponymous class, hence preventing its
usage.
2017-09-26 18:17:47 +02:00
Mark Thomas
2dff07bf2e merge: improve comments in mergestate._makerecords
Differential Revision: https://phab.mercurial-scm.org/D955
2017-10-05 08:03:57 -07:00
Mark Thomas
40122867eb commands: tidy up merge state decoding in resolve
Make the mapping from merge state to label and display key explicit, and move
construction of the dict out of the loop.

Differential Revision: https://phab.mercurial-scm.org/D861
2017-10-02 14:05:30 -07:00
Mark Thomas
9e54508e20 context: also consider path conflicts when clearing unknown files
When clearing unknown files to remove path conflicts, also delete files that
conflict with the target file's path.

Differential Revision: https://phab.mercurial-scm.org/D785
2017-10-02 14:05:30 -07:00
Mark Thomas
75628a759b merge: check for path conflicts when merging (issue5628)
When merging, check for any path conflicts introduced by the manifest
merge and rename the conflicting file to a safe name.

Differential Revision: https://phab.mercurial-scm.org/D784
2017-10-02 14:05:30 -07:00
Mark Thomas
e2916432c0 util: add safename function for generating safe names to rename to
This function finds a name which does not clash with any other name in the
manifest, and so can be used to safely rename a file.

Differential Revision: https://phab.mercurial-scm.org/D783
2017-10-02 14:05:30 -07:00
Mark Thomas
08fafa25e1 merge: improve error messages for path conflicts during update
Differential Revision: https://phab.mercurial-scm.org/D782
2017-10-02 14:05:30 -07:00
Mark Thomas
710343cbad merge: check for path conflicts when updating (issue5628)
When updating to a new revision, check for path conflicts caused by unknown
files in the working directory, and handle these by backing up the file or
directory and replacing it.

Differential Revision: https://phab.mercurial-scm.org/D781
2017-10-02 14:05:30 -07:00
Mark Thomas
8d254022c6 merge: rename conflicts to fileconflicts in _checkunknownfiles
We will need to distinguish between file conflicts and path conflicts.  Rename
the conflicts variable so that it will be clearly distinct from pathconflicts,
which will be introduced in a future commit.

Differential Revision: https://phab.mercurial-scm.org/D780
2017-10-02 14:05:30 -07:00
Mark Thomas
3e2f0b4499 merge: add _checkunknowndirs function for detecting path conflicts
Add a new function which, given a file name, finds the shortest path for which
there is a conflicting file or directory in the working directory.

Differential Revision: https://phab.mercurial-scm.org/D779
2017-10-02 14:05:30 -07:00
Mark Thomas
8fecfcf567 merge: backup conflicting directories when getting files
During batchget, if a target file conflicts with a directory, or if the
directory a target file is in conflicts with a file, backup and remove the
conflicting file or directory before performing the get.

Differential Revision: https://phab.mercurial-scm.org/D778
2017-10-02 14:05:30 -07:00
Mark Thomas
510a16a534 merge: add merge action 'pr' to rename files during update
Add a new merge action to handle a path conflict by renaming the conflicting
file to a safe name.

The rename is just to avoid problems on the filesystem.  The conflict is still
considered unresolved until the user marks the original path as resolved.

Differential Revision: https://phab.mercurial-scm.org/D777
2017-10-02 14:05:30 -07:00
Mark Thomas
813b547c22 merge: add merge action 'p' to record path conflicts during update
Add a new merge action to record path conflicts.  A status message is
printed, and the path conflict is added to the merge state.

Differential Revision: https://phab.mercurial-scm.org/D776
2017-10-02 14:05:30 -07:00
Mark Thomas
6bd6e494d4 commands: update the resolve command to handle path conflicts
The resolve command must support displaying path conflicts and marking
them as resolved or unresolved.

Differential Revision: https://phab.mercurial-scm.org/D775
2017-10-02 14:05:30 -07:00
Mark Thomas
73522e2f05 merge: add pathconflict merge state
Path conflicts that occur during merges are represented by 'pu' (unresolved)
and 'pr' (resolved) records in the merge state.  These are stored on disk
in 'P' records.

Differential Revision: https://phab.mercurial-scm.org/D774
2017-10-02 14:05:30 -07:00
Mark Thomas
0af395f454 scmutil: handle conflicting files and dirs in origbackuppath
When ui.origbackuppath is set, .orig files are stored outside of the working
copy.  However conflicts can occur when files or directories end up having the
same name.  These conflicts cause Mercurial to abort, even if they've been
created as a result of different backups.

Make sure we always replace files or directories in the origbackuppath if
they conflict with another file or directory.

Test Plan:
Add new unit test for conflicting paths.

Differential Revision: https://phab.mercurial-scm.org/D680
2017-10-02 14:05:30 -07:00
Yuya Nishihara
a92ecdf646 extdata: show debug message if external command exits with non-zero status
This isn't fatal because it's quite common for grep to exit with 1. Thanks to
Foozy for spotting this.
2017-10-01 12:21:50 +01:00
Yuya Nishihara
ef440af2e7 templatekw: allow accessing to nested namespace item by its template name
Since we have the dot operator, it makes more sense to write

  {namespaces.tags % "{tag}"}

instead of

  {namespaces.tags % "{name}"}
2017-09-30 08:57:50 +01:00
Yuya Nishihara
ccb359526e templatekw: get rid of temporary dicts from shownamespaces() 2017-09-30 08:50:24 +01:00
Yuya Nishihara
296d077704 templatekw: rename peerpaths to peerurls per naming convention (BC)
Since each element is called as "url", the template keyword should be named
as "<whatever>urls".

{peerurls} is now stabilized.
2017-09-18 23:53:05 +09:00