Commit Graph

19772 Commits

Author SHA1 Message Date
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
Yuya Nishihara
db07c1fcd9 templatekw: make experimental {peerpaths} return a single-level dict (BC)
This was planned as in 2bcc691583ec, "{peerpaths.default.pushurl} will be
translated to peerpaths['default'].makemap()['pushurl'], which means
{peerpaths} should be a single-level dict and sub-options should be
makemap()-ed."
2017-09-18 23:31:01 +09:00
Yuya Nishihara
3d25496222 templatekw: fix scope of peerpath url bound to generator
I had to explicitly bind 'd' to the generator. Otherwise, the last 'd' would
be used.
2017-09-18 23:49:05 +09:00
Yuya Nishihara
2a17199870 templater: extend dot operator as a short for get(dict, key) 2017-09-18 23:07:17 +09:00
Yuya Nishihara
6215164ca2 templater: add dot operator to easily access a sub item
This and the next patch will allow us to access a deeply-nested item
by foo.bar.baz syntax.
2017-09-09 19:32:56 +09:00
Yuya Nishihara
366ad4616f templater: wrap get/min/max result so map operation can apply to element
See the test for usage example.

wraphybridvalue() takes a key/value pair because a hybrid dict passes a key
to its makemap() function. Since makemap() of showmanifest() doesn't need
a key, it's set to None.
2017-09-09 19:13:25 +09:00
Yuya Nishihara
f412c69557 dispatch: move initialization of sys.std* files
I'll add another Python 3 hack.
2017-10-02 07:18:24 +01:00
Yuya Nishihara
5362d4999c py3: work around the scope of exception variable in dispatch.run()
https://stackoverflow.com/questions/29268892/
2017-10-02 06:52:10 +01:00
Boris Feld
ef49af43a4 configitems: register the 'experimental.graphstyle.grandparent' config 2017-10-08 22:07:47 +02:00
Boris Feld
6cc61934ba configitems: register the 'experimental.graphstyle.missing' config 2017-10-08 22:07:21 +02:00
Boris Feld
cfcda827e5 configitems: register the 'experimental.graphstyle.parent' config 2017-10-08 22:06:35 +02:00
Boris Feld
d4002dd1cf configitems: register the 'devel.empty-changegroup' config 2017-10-08 21:41:37 +02:00
Boris Feld
5726c2856c configitems: register the 'devel.cache-vfs' config 2017-10-08 21:41:22 +02:00
Boris Feld
e9fb6c7c88 configitems: register the 'devel.warn-config-default' config 2017-10-08 21:36:26 +02:00
Boris Feld
4181ce9d65 configitems: register the 'devel.warn-config' config 2017-10-08 21:41:10 +02:00
Boris Feld
40e88b2e2b configitems: register 'merge.checkunknown' and 'merge.checkignored'
They both use the same function defining a default, so we need to update them at
the same time.
2017-10-08 21:48:40 +02:00
Boris Feld
2063677b32 configitems: register the 'diff.*' config
All the config were already using a unified function with a forced default, so,
registering them all at once seems safe.
2017-10-08 21:47:14 +02:00
Boris Feld
8d053639dd configitems: register the 'experimental.mmapindexthreshold' config 2017-10-08 20:43:46 +02:00
Boris Feld
ea847730ea configitems: register the 'experimental.maxdeltachainspan' config 2017-10-08 20:42:19 +02:00
Pulkit Goyal
2251d97e92 copies: add docs for config experimental.copytrace.sourcecommitlimit
This patch adds documentation for the config option. The config name does not
convey much and hence documentation was required.

Differential Revision: https://phab.mercurial-scm.org/D986
2017-10-08 04:39:42 +05:30
Augie Fackler
0c9dc5bb90 hgweb: extract function for loading style from request context
Also make it work on Python 3.

Differential Revision: https://phab.mercurial-scm.org/D970
2017-10-05 14:29:13 -04:00
Augie Fackler
0f33c5f4f4 request: coerce content-type to native str
Again, required by WSGI.

Differential Revision: https://phab.mercurial-scm.org/D969
2017-10-05 14:27:21 -04:00
Augie Fackler
437290aeb9 request: use trivial iterator over dictionary keys
Differential Revision: https://phab.mercurial-scm.org/D968
2017-10-05 14:26:09 -04:00
Augie Fackler
02378a67e1 hgweb: when constructing or adding to a wsgi environ dict, use native strs
That's what's required of us to work with the WSGI API on Python 3.

Differential Revision: https://phab.mercurial-scm.org/D967
2017-10-05 14:22:02 -04:00
Augie Fackler
70bdecfdf5 hgweb: produce native string for etag value
Also use %d since we know mtime is numeric.

Differential Revision: https://phab.mercurial-scm.org/D966
2017-10-05 14:17:50 -04:00
Augie Fackler
395bba3900 hgweb: in protocol adapter, look for bytes instances, not str
Differential Revision: https://phab.mercurial-scm.org/D963
2017-10-05 14:13:20 -04:00
Augie Fackler
38c5b420ba hgweb: in protocol adapter, avoid control reaching end of non-void function
This greatly confounded some Python 3 porting work, once it was
managing to get this far.

Differential Revision: https://phab.mercurial-scm.org/D962
2017-10-05 14:12:51 -04:00
Pulkit Goyal
fbd5da487b py3: use '%d' for integers instead of '%s'
Differential Revision: https://phab.mercurial-scm.org/D973
2017-10-02 04:48:06 +05:30
Boris Feld
112417d22c configitems: register the 'experimental.nonnormalparanoidcheck' config 2017-06-30 03:41:49 +02:00
Boris Feld
9d0cb965ed configitems: register the 'experimental.allowdivergence' config 2017-06-30 03:39:44 +02:00
Alex Gaynor
88c328dbf9 style: never use a space before a colon or comma
Differential Revision: https://phab.mercurial-scm.org/D954
2017-09-29 15:48:34 +00:00
Jun Wu
bcceeef325 eol: make [eol] config section sensitive for chg confighash
The eol extension may mangle the [eol] config section and that means chg is
unable to detect config file change (because it re-applies setconfig
changes).

This makes test-eol.t pass with chg.

Differential Revision: https://phab.mercurial-scm.org/D917
2017-10-02 19:25:11 -07:00
Augie Fackler
ffcbb8d170 ui: convert to/from Optional[bytes] to Optional[str] in password manager
This password manager proxy is roughly the right-looking layer to
convert between strings and bytes. Many of these arguments can be
None, so we have a helper method to make the conversion preserve Nones
without exploding.

Differential Revision: https://phab.mercurial-scm.org/D886
2017-10-01 12:10:48 -04:00