Commit Graph

7648 Commits

Author SHA1 Message Date
Yuya Nishihara
b70e3d719f tags: change field name of formatter output to be the same as log command
Since -T option is not public yet, this won't break backward compatibility.
2014-09-21 12:46:23 +09:00
Mads Kiilerich
44bd94dc4e mq: refactor patchheader header ordering to match export (BC)
The refactoring also gives more robust and extendable handling of other HG
headers.
2014-09-24 02:41:11 +02:00
Mads Kiilerich
67c67bcdbe mq: upgrade non-plain patches to HG format when setting parent in patchheader
Parent will now always be updated or added when qrefreshing HG patches. Plain
patches will not be changed, but patches that neither are plain nor HG will be
upgraded to HG patches on first refresh.
2014-09-20 17:06:57 +02:00
Siddharth Agarwal
ca3e00a8e3 histedit: abort gracefully on --continue/--abort with no state
Previously we'd print an ugly message saying that the histedit-state file
doesn't exist in the repo.
2014-09-03 20:42:51 +02:00
Aaron Kushner
c8faef4c5a config: exit non zero on non-existent config option (issue4247)
When running 'hg config no_such_option', hg exited with a
zero exit code. This change now exits with a 1 if the
config option does not exist.
2014-08-19 16:57:02 -07:00
FUJIWARA Katsunori
5c74f6bc14 import: show the warning message for failure of merging
Before this patch, no message is shown for failure of merging at "hg
import".

In such case, merging patch is imported as a normal revision silently,
and it may confuse users.

For simplicity, this patch recommends just using "--exact", even
though importing the merging patch itself is possible without it if:

  - the hash of the 1st parent in the patch is equal to one of the
    patch imported just before (or the parent of the working
    directory, for the 1st patch of the series), and

  - the hash of the 2nd parent in the patch is known in the local
    repository
2014-08-27 23:10:06 +09:00
Mads Kiilerich
bb5bc3c743 graft: fix collision detection with origin revisions that are missing
When grafting something with a matching origin, it would normally be skipped:
  skipping already grafted revision 123 (23 also has origin 12)

But after stripping a graft origin, graft could fail with a reference to the
origin that no longer exists:
  abort: unknown revision '5c095ad7e90f871700f02dd1fa5012cb4498a2d4'!

Instead, detect that the origin is unknown and skip it anyway, like:
  skipping already grafted revision 8 (2 also has unknown origin 5c095ad7e90f871700f02dd1fa5012cb4498a2d4)
2014-08-27 15:30:09 +02:00
Mads Kiilerich
7f9b497a4c incoming: don't request heads that already are common
Pull would send a getbundle command where common heads were sent both as common
and head, even though there is no reason to request a common head.
The request was thus twice as big as necessary and more likely to hit HTTP
header size limits.

Instead, don't request heads that already are common.

This is fixed in bundlerepo.getremotechanges . It could perhaps also have been
fixed in discovery.findcommonincoming but that would have a bigger impact.
2014-08-15 03:24:40 +02:00
Mads Kiilerich
c6b11d841f tests: improve test coverage for discovery and actual parameters for pulling 2014-08-15 03:24:40 +02:00
Mads Kiilerich
af05e75b06 changectx: ancestor should only prefer merge.preferancestor if it is a revision
The value '*' currently designates that bid merge should be used. The best
way to test bid merge is to set preferancestor=* in the configuration file ...
but then it would abort with unknown revision '*' when other code paths ended
up in changectx.ancestor .

Instead, just skip and ignore the value '*' when looking for a preferred
ancestor.
2014-08-15 02:46:44 +02:00
Mads Kiilerich
26f83c4483 merge: show the scary multiple ancestor hint for merges only, not for updates
Updates with uncommited changes will always only have one ancestor - the parent
revision. Updates between existing revision should (and will) always give the
same result no matter which ancestor is used. The warning is thus only relevant
when doing a "real" merge.
2014-08-15 02:39:01 +02:00
Pierre-Yves David
8bf8eb1b78 obsstore.create: add a simple safeguard against cyclic markers
We detect when there is a cycle in the marker itself (precursors being listed
as successors).
2014-08-14 14:59:42 -07:00
Matt Mackall
24638bb76c test-run-tests: fix up slash/backslash on diff chunks for Windows 2014-08-14 16:18:45 -05:00
Siddharth Agarwal
26dccff015 test-largefiles: add test for hg log --follow --patch with path
This was the one case for test-largefiles that was not broken.
2014-08-13 15:55:45 -07:00
Siddharth Agarwal
6e2ab4d61f largefiles: don't override matchandpats for always matchers (issue4334)
This makes hg log --follow --patch work, since in cmdutil._makelogrevset we
use the non-follow matcher for hg log --follow --patch with no file arguments.
2014-08-13 15:51:33 -07:00
Siddharth Agarwal
c70d49625f largefiles: in overridelog, use non-lf matcher for patch generation (issue4334)
This has actually been broken since at least Mercurial 2.8 -- hg log --patch
with largefiles only used to work when no largefiles existed. Rev 658ce4a0a0a9
exposed this bug for all cases.
2014-08-13 15:18:41 -07:00
Martin von Zweigbergk
69e9a354a2 histedit: preserve initial author on fold (issue4296)
When the authorship of the changeset folded in does not match that of
the base changeset, we currently use the configured ui.username
instead. This is especially surprising when the user is not the author
of either of the changesets. In such cases, the resulting authorship
(the user's) is clearly incorrect. Even when the user is folding in a
patch they authored themselves, it's not clear whether they should
take over the authorship. Let's instead keep it simple and always
preserve the base changeset's authorship. This is also how
"git rebase -i" handles folding/squashing.
2014-08-13 11:50:13 -07:00
Matt Mackall
1fc52a716b run-tests: fix some io ordering
backported from default
2014-08-13 18:50:35 -05:00
Matt Mackall
28afeddddf test-run-tests: fix stdout/stderr io ordering 2014-08-13 14:05:08 -05:00
Matt Mackall
158e001efc run-tests: don't double lines on build failure output 2014-08-12 11:17:29 -05:00
Matt Mackall
696a2d25ed test-run-tests: filter pwd alias for Windows 2014-08-12 11:10:57 -05:00
Matt Mackall
4437029857 run-tests: self-test on Windows needs binary streams 2014-08-12 11:02:30 -05:00
Michael O'Connor
306b55bcc9 revset: bookmark revset interprets 'literal:' prefix correctly (issue4329) 2014-08-11 23:45:08 -04:00
Matt Mackall
65d57189d4 unbundle: don't advance bookmarks (issue4322) (BC)
This behavior didn't make much sense and interacts badly with things
that use unbundle internally like shelve. Presumably, the original
rationale was that since bundles didn't contain bookmarks, this gave a
sense of keeping bookmarks up-to-date like would happen with a
corresponding pull. However, since it only updated the current active
bookmark, and bare update already did that anyway, this is pretty
slim.

Notably, the corresponding test actually works better without this
feature.
2014-08-10 23:09:23 -05:00
Matt Mackall
2bfc2c18d4 tests: more bundle2 non-binary file test fixes 2014-08-10 15:26:12 -05:00
Matt Mackall
8bff782c4b test-commandserver.py: filter path separator
Was failing on Windows:

-bundle.mainreporoot=$TESTTMP/repo
+bundle.mainreporoot=$TESTTMP\repo
2014-08-09 16:15:52 -05:00
Pierre-Yves David
6b79b1a061 status: don't drop unknown and ignored information (issue4321)
By the magic of code movement, we ended up dropping unknown and ignored
information when comparing the working directory with a non-parent revision.

Let's stop doing it and add a test.
2014-08-01 12:49:00 -07:00
Yuya Nishihara
4d834f9237 log: do not use exact matcher for --patch --follow without file (issue4319)
5d9f39626224 is valid only if file argument is specified.  If no pattern
specified, it can simply fall back to the original matcher.
2014-08-01 21:36:56 +09:00
Matt Mackall
488f376f73 qimport: record imported revs incrementally (issue3874)
When an import fails, this doesn't lose the state for the earlier
revisions.
2014-07-31 16:32:12 -05:00
Matt Mackall
75584584e7 test-bundle2: add missing os import 2014-07-31 16:01:01 -05:00
Matt Mackall
73a6114d2a help: always show command help with -h (issue4240)
Old behavior:
              hg help x    hg x -h    hg help -e x  hg help -c x
config        topic        topic (!)  -             cmd
showconfig    cmd          topic (!)  -             cmd
rebase        cmd          cmd        ext           cmd

New behavior:
              hg help x    hg x -h    hg help -e x  hg help -c x
config        topic        cmd        -             cmd
showconfig    cmd          cmd        -             cmd
rebase        cmd          cmd        ext           cmd
2014-07-31 14:31:31 -05:00
Matt Mackall
888b6892dd test-bundle2: move file mode setting after sys import 2014-07-30 18:28:37 -05:00
anatoly techtonik
023b57a106 config: allow 'user' in .hgrc ui section (issue3169) 2014-07-26 09:27:11 +03:00
FUJIWARA Katsunori
5f213b8584 doc: unify help text for "--edit" option
This patch changes help text for "--edit" option of commands below:

  - fetch
  - qnew
  - qrefresh
  - qfold
  - commit
  - tag

This unification reduces translation cost, too.

This patch chooses not "further edit commit message already specified"
(of "hg commit") but "invoke editor on commit messages" as unified
help text for "--edit" option, because the latter is much older than
the former.
2014-07-30 00:14:52 +09:00
Augie Fackler
73aafc176d histedit: respect revsetalias entries (issue4311)
We now expand user-provided revsets before using repo.revs() to locate
the root(s) of the user-specified set.
2014-07-28 19:20:13 -04:00
Pierre-Yves David
3efa776f85 resolve: add parenthesis around "no more unresolved files" message
This message may be confused with an error message. Adding parenthesis around it
will make it more recognisable as an informative message.
2014-07-26 03:32:49 +02:00
Matt Mackall
f648f507dd templates: re-add template listing support
We used to have --style nosuch to list templates, but --style is now
merged with --template/-T where random strings are acceptable
templates. So we reserve 'list' to allow listing templates.
2014-07-25 15:35:09 -05:00
Yuya Nishihara
2db6b6d9ea test-status: add test for removed-and-untracked state (BC)
In Mercurial 3.0, "hg status" can list the same file twice if it was removed
but still exists in working directory, i.e. removed by "hg forget":

  $ hg status --rev 0 removed
  R removed
  ? removed

But since 64d05ea3a10f, untracked state, "?", is no longer displayed in this
example.

I think the new behavior is correct since a file should have single state, but
if it is a bug, this patch should be dropped.
2014-07-24 23:39:25 +09:00
Pierre-Yves David
4ab165af6a bundle2: only use callable return as reply handler
When a bundle2 parts generator returns a non callable value, it should not be
used as a reply handler. The changegroup part generator is already having this
case of behavior when there is no changegroup to push. This changeset prevent a
crash for user of the experimentable bundle2 feature.
2014-07-02 16:13:48 +02:00
Nathan Goldbaum
46f5e72040 resolve: report no argument warning using a hint
With this change resolve and revert produce consistent output when run with no
arguments:

$ hg resolve
abort: no files or directories specified
(use --all to remerge all files)

$ hg revert
abort: no files or directories specified
(use --all to revert all files)
2014-07-24 14:29:08 -07:00
Matt Mackall
97770302de version: don't traceback if no extensions to list (issue4312) 2014-07-23 11:16:22 -05:00
FUJIWARA Katsunori
8c6b77e441 largefiles: use "normallookup" on "lfdirstate" while reverting
Before this patch, largefiles gotten from revisions other than the
parent of the working directory at "hg revert" become "clean"
unexpectedly in steps below:

    1. "repo.status()" is invoked (for status check before reverting)
      1-1 "dirstate" entry for standinfile SF is "normal"-ed
     (1-2 "lfdirstate" entry of largefile LF (for SF) is "normal"-ed)

    2. "cmdutil.revert()" is invoked
      2-1 standinfile SF is updated in the working directory
      2-2 "dirstate" entry for SF is NOT updated

    3. "lfcommands.updatelfiles()" is invoked (by "overrides.overriderevert()")
      3-1 largefile LF (for SF) is updated in the working directory
      3-2 "dirstate" returns "n" and valid timestamp for SF (by 1-1 and 2-2)
      3-3 "lfdirstate" entry for LF is "normal"-ed
      3-4 "lfdirstate" is written into ".hg/largefiles/dirstate", and
          timestamp of LF is stored into "lfdirstate" file (by 3-3)
          (ASSUMPTION: timestamp of LF differs from one of "lfdirstate" file)

Then, "hs status" treats LF as "clean", even though LF is updated by
"other" revision (by 3-1), because "lfilesrepo.status()" always treats
"normal"-ed files (by 3-3 and 3-4) as "clean".

When largefiles are reverted, they should be "normallookup"-ed
forcibly.

This patch uses "normallookup" on "lfdirstate" while reverting, by
passing "True" to newly added argument "normallookup".

Forcible "normallookup"-ing is not so expensive, because list of
target largefiles is explicitly specified in this case.

This patch uses "[debug] dirstate.delaywrite" feature in the test, to
ensure that timestamp of the largefile gotten from "other" revision is
stored into ".hg/largefiles/dirstate" (for ASSUMPTION at 3-4)
2014-07-23 00:10:24 +09:00
FUJIWARA Katsunori
f5a07da3f0 largefiles: invoke "normallookup" on "lfdirstate" for merged files
Before this patch, largefiles gotten from "other" revision (with
conflict) at "hg merge" become "clean" unexpectedly in steps below:

    1. "repo.status()" is invoked (for status check before merging)
      1-1 "dirstate" entry for standinfile SF is "normal"-ed
      1-2 "lfdirstate" entry of largefile LF (for SF) is "normal"-ed

    2. "merge.update()" is invoked
      2-1 SF is updated in the working directory
          (ASSUMPTION: user choice "other" at conflict)
      2-2 "dirstate" entry for SF is "merge"-ed

    3. "lfcommands.updatelfiles()" is invoked (by "overrides.hgmerge()")
      3-1 largefile LF (for SF) is updated in the working directory
      3-2 "dirstate" returns "m" for SF (by 2-2)
      3-3 "lfdirstate" entry for LF is left as it is
      3-4 "lfdirstate" is written into ".hg/largefiles/dirstate", and
          timestamp of LF is stored into "lfdirstate" file (by 1-2)
          (ASSUMPTION: timestamp of LF differs from one of "lfdirstate" file)

Then, "hs status" treats LF as "clean", even though LF is updated by
"other" revision (by 3-1), because "lfilesrepo.status()" always treats
"normal"-ed files (by 1-2 and 3-4) as "clean".

When state of standinfile in "dirstate" is "m", largefile should be
"normallookup"-ed.

This patch invokes "normallookup" on "lfdirstate" for merged files.

This patch uses "[debug] dirstate.delaywrite" feature in the test, to
ensure that timestamp of the largefile gotten from "other" revision is
stored into ".hg/largefiles/dirstate". (for ASSUMPTION at 3-4)
2014-07-23 00:10:24 +09:00
FUJIWARA Katsunori
c24b717f3e largefiles: use "normallookup", if "mtime" of standin is unset
Before this patch, largefiles gotten from "other" revision (without
conflict) at "hg merge" become "clean" unexpectedly in steps below:

    1. "merge.update()" is invoked
      1-1 standinfile SF is updated in the working directory
      1-2 "dirstate" entry for SF is "normallookup"-ed

    2. "lfcommands.updatelfiles()" is invoked (by "overrides.hgmerge()")
      2-1 largefile LF (for SF) is updated in the working directory
      2-2 "dirstate" returns "n" for SF (by 1-2)
      2-3 "lfdirstate" entry for LF is "normal"-ed
      2-4 "lfdirstate" is written into ".hg/largefiles/dirstate", and
          timestamp of LF is stored into "lfdirstate" file
          (ASSUMPTION: timestamp of LF differs from one of "lfdirstate" file)

Then, "hs status" treats LF as "clean", even though LF is updated by
"other" revision (by 2-1), because "lfilesrepo.status()" always treats
"normal"-ed files (by 2-3 and 2-4) as "clean".

When timestamp is not set (= negative value) for standinfile in
"dirstate", largefile should be "normallookup"-ed regardless of
rebasing or not, because "n" state in "dirstate" doesn't ensure
"clean"-ness of a standinfile at that time.

This patch uses "normallookup" instead of "normal", if "mtime" of
standin is unset

This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, "lfdirstate" should
be updated with "dirstate" simultaneously while "merge.update"
execution: maybe by hooking "recordupdates"

It is also why this patch (temporarily) uses internal field "_map" of
"dirstate" directly.

This patch uses "[debug] dirstate.delaywrite" feature in the test, to
ensure that timestamp of the largefile gotten from "other" revision is
stored into ".hg/largefiles/dirstate". (for ASSUMPTION at 2-4)

This patch newly adds "test-largefiles-update.t", to avoid increasing
cost to run other tests for largefiles by subsequent patches
(especially, "[debug] dirstate.delaywrite" causes so).
2014-07-22 23:59:34 +09:00
Danek Duvall
151b68d8da tests: cat error messages are different on Solaris 2014-07-21 11:27:24 -07:00
Matt Harbison
f0308c64dd revset: avoid a ValueError when 'only()' is given an empty set
This previously died in _revdescendants() taking the min() of the first set to
only(), when it was empty.  An empty second set already worked.  Likewise,
descendants() already handled an empty set.
2014-07-18 19:46:56 -04:00
FUJIWARA Katsunori
f9743bb802 cmdutil: make commit message shown in text editor customizable by template
This patch makes commit message shown in text editor customizable by
template. For example, this can advertise:

  - sample commit messages for routine works,
  - points to call attention before commit,
  - message of the day, and so on

To show commit message correctly even in problematic encoding, this
patch chooses the latter below:

  - replace "buildcommittext" with "buildcommittemplate" completely

  - invoke "buildcommittemplate" only if '[committemplate] changeset'
    is configured explicitly

For example, if multibyte character ending with backslash (0x5c) is
followed by ASCII character 'n' in the customized template, sequence
of backslash and 'n' is treated as line-feed unexpectedly (and
multibyte character is broken, too).

This corruption occurs in 'decode("string-escape")' while parsing
template string.
2014-07-15 23:34:13 +09:00
Angel Ezquerra
38433239a4 filemerge: add internal:tagmerge merge tool
Add a new internal:tagmerge merge tool which implements an automatic merge
algorithm for mercurial's tag files

The tagmerge algorithm is able to resolve most merge conflicts that
currently would trigger a .hgtags merge conflict. The only case that
it does not (and cannot) handle is that in which two tags point to
different revisions on each merge parent _and_ their corresponding tag
histories have the same rank (i.e. the same length). In all other
cases the merge algorithm will choose the revision belonging to the
parent with the highest ranked tag history. The merged tag history is
the combination of both tag histories (special care is taken to try to
combine common tag histories where possible).

The algorithm also handles cases in which tags have been manually
removed from the .hgtags file and other similar corner cases.

In addition to actually merging the tags from two parents, taking into
account the base, the algorithm also tries to minimize the difference
between the merged tag file and the first parent's tag file (i.e. it
tries to make the merged tag order as as similar as possible to the
first parent's tag file order).

The algorithm works as follows:
1. read the tags from p1, p2 and the base
    - when reading the p1 tags, also get the line numbers associated to each
      tag node (these will be used to sort the merged tags in a way that
      minimizes the diff to p1). Ignore the file numbers when reading p2 and
      the base
2. recover the "lost tags" (i.e. those that are found in the base but not on p1
   or p2) and add them back to p1 and/or p2
    - at this point the only tags that are on p1 but not on p2 are those new
      tags that were introduced in p1. Same thing for the tags that are on p2
      but not on p2
3. take all tags that are only on p1 or only on p2 (but not on the base)
    - Note that these are the tags that were introduced between base and p1 and
      between base and p2, possibly on separate clones
4. for each tag found both on p1 and p2 perform the following merge algorithm:
    - the tags conflict if their tag "histories" have the same "rank" (i.e.
      length) _AND_ the last (current) tag is _NOT_ the same
    - for non conflicting tags:
        - choose which are the high and the low ranking nodes
            - the high ranking list of nodes is the one that is longer.
              In case of draw favor p1
            - the merged node list is made of 3 parts:
                - first the nodes that are common to the beginning of both the
                  low and the high ranking nodes
                - second the non common low ranking nodes
                - finally the non common high ranking nodes (with the last one
                  being the merged tag node)
            - note that this is equivalent to putting the whole low ranking node
              list first, followed by the non common high ranking nodes
    - note that during the merge we keep the "node line numbers", which will
      be used when writing the merged tags to the tag file
5. write the merged tags taking into account to their positions in the first
   parent (i.e. try to keep the relative ordering of the nodes that come
   from p1). This minimizes the diff between the merged and the p1 tag files
   This is done by using the following algorithm
    - group the nodes for a given tag that must be written next to each other
        - A: nodes that come from consecutive lines on p1
        - B: nodes that come from p2 (i.e. whose associated line number is None)
             and are next to one of the a nodes in A
        - each group is associated with a line number coming from p1
    - generate a "tag block" for each of the groups
        - a tag block is a set of consecutive "node tag" lines belonging to the
          same tag and which will be written next to each other on the merged
          tags file
    - sort the "tag blocks" according to their associated number line
        - put blocks whose nodes come all from p2 first
    - write the tag blocks in the sorted order

Notes:
- A few tests have been added to test-tag.t. These tests are very specific to
the new internal:tagmerge tool, so perhaps they should be moved to their own
test file.
- The merge algorithm was discussed in a thread on the mercurial mailing list.
In http://markmail.org/message/anqaxldup4tmgyrx a slightly different algorithm
was suggested. In it the p1 and p2 tags would have been interleaved instead of
put one before the other. It would be possible to implement that but my tests
suggest that the merge result would be more confusing and harder to understand.
2014-06-26 01:20:25 +02:00
Matt Mackall
dcb326f0e5 filemerge: use non-minimal conflict marker regions (BC)
As extensively detailed by Pierre-Yves[1], simplemerge's minimal
markers can result in hopeless confusion for many common merges. As it
happens, we accidentally inherited this behavior when we borrowed
simplemerge from bzr; it is not the behavior used by RCS's merge(1),

Since merge(1) (and not bzr) is what we aim to emulate when emulating
RCS's merge markers, we simply turn this feature off. This brings us
in line with the behavior of CVS, SVN, and Git as a bonus.

(NB: using conflict markers with Mercurial is discouraged.)

[1] http://markmail.org/message/wj5mh3lc46czlvld

convert glob tessa
2014-07-18 21:49:52 -05:00
Pierre-Yves David
9ce4e0fa84 test: use more elaborated content in `test-conflict.t`
We are going to introduce a setting to control the "minimisation" feature of
``internal:merge``. So we need more interesting conflicting content. We change
the content in an independent changeset to make sure the coming code change
leave the output unchanged.
2014-06-09 03:49:07 -07:00
Matt Mackall
0eb76768ec run-tests: make --view work again 2014-07-18 17:52:18 -05:00
FUJIWARA Katsunori
ba5b3b9f46 filemerge: use 'basic' as the default of '[ui] mergemarkers' for safety
Before this patch, 'detailed' is used as the default of '[ui]
mergemarkers'. This embeds non-ASCII characters in tags, branches,
bookmarks, author and/or commit descriptions into merged files in the
encoding specified by '--encoding' global option, 'HGENCODING' or
other locale setting environment variables.

But, if files to be merged use another encoding, this behavior breaks
consistency of encoding in merged files.

For example, ISO-2022-JP or EUC-JP are sometimes used as the file
encoding for Japanese characters, because of historical and/or
environmental reasons, even though UTF-8 or Shift-JIS are ordinarily
used as the terminal encoding.

This can't be resolved automatically, because Mercurial doesn't aware
encoding of managed files.

This patch uses 'basic' as the default of '[ui] mergemarkers' to avoid
embedding encoding sensitive characters for safety.

This patch puts '[ui] mergemarkers = detailed' into default hgrc file
for tests, to reduce changes for tests in this patch.
2014-07-06 02:56:41 +09:00
Matt Harbison
cbf609dee6 largefiles: avoid unnecessary creation of .hg/largefiles when opening lfdirstate
Previously, the directory '.hg/largefiles' would always be created if it didn't
exist when the lfdirstate was opened.  If there were no standin files, no
dirstate file would be created in the directory.  The end result was that
enabling the largefiles extension globally, but not explicitly adding a
largefile would result in the repository eventually sprouting this directory.

Creation of this directory effectively changes readonly operations like summary
and status into operations that require write access.  Without write access,
commands that would succeed without the extension loaded would abort with a
surprising error when the extension is loaded, but not actively used:

  $ hg sum -R /tmp/thg --config extensions.largefiles=
  parent: 16541:00dc703d5aed
   repowidget: specify incoming bundle by plain file path to avoid url parsing
  branch: default
  abort: Permission denied: '/tmp/thg/.hg/largefiles'


This change is simpler than changing the callers of openlfdirstate() to use the
'create' parameter that was introduced in 74522122b97d, and probably how that
should have been implemented in the first place.
2014-07-17 20:17:17 -04:00
Mads Kiilerich
600dadebda mq: write '# Parent ' lines with two spaces like export does (BC)
This aligns "Parent" node IDs with "Node ID" node IDs.
2014-09-24 01:36:44 +02:00
Mads Kiilerich
3ed8837146 mq: write headers for new HG patches in the same order as export (BC) 2014-09-20 17:06:56 +02:00
Mads Kiilerich
8c41a3576b mq: correctly make an empty line after description in new patches
There would in some cases be an empty line between headers and the description -
that does not seem right.

There should also be an empty line between description and diff - but that was
missing.

These two mistakes would sometimes make it up for each other so we fix both at
once to just show the improvement.

Instead of writing an extra newline when writing a header line, write an extra
line when it not is written as a part of the description but is necessary
anyway.
2014-09-20 17:06:56 +02:00
Siddharth Agarwal
f149aa54b6 convert: change default for git rename detection to 50%
This default mirrors the default for 'git diff'. Other commands have slightly
different defaults -- for example, the move/copy detection for 'git blame'
assumes that a hunk is moved if more than 40 alphanumeric characters are the
same, or copied if more than 20 alphanumeric characters are the same. 50% seems
to be the most common default, though.
2014-09-23 14:45:23 -07:00
Siddharth Agarwal
f28296d4ee convert: simplify git.similarity parsing 2014-09-23 14:40:32 -07:00
Matt Mackall
b08b629028 merge with stable 2014-09-22 16:14:08 -05:00
Matt Mackall
4821ef7629 commands: deprecate the parents commands
It's replaced by 'hg summary' or hg log -r 'parents(foo)' and
doesn't need to take up space in our command list anymore.
2014-09-22 16:03:07 -05:00
anuraggoel
7937672970 run-tests: added 'cuser', 'csys' time info in report.json file
This patch adds up a 'cuser' and 'csys'(cputime) info in report.json file
which generated when --json is enabled while testing.

Now the new format of report.json file is as below.

testreport ={
    "test-success.t": {
        "csys": "1.041",
        "cuser": "1.041",
        "result": "success",
        "time": "2.041"
    }
    "test-failure.t": {
        "csys": "1.041",
        "cuser": "1.041",
        "result": "failure",
        "time": "4.430"
    }
    "test-skip.t": {
        "csys": "1.041",
        "cuser": "1.041",
        "result": "skip",
        "time": "3.754"
    }
}
2014-09-19 07:23:10 +05:30
Matt Mackall
512fbd2843 import: let --exact 'work' with --no-commit (issue4376) 2014-09-19 14:51:58 -05:00
Yuya Nishihara
6ecd008e93 annotate: port to generic templater enabled by hidden -T option
If the selected formatter is other than plainformatter, raw data are passed
to the formatter.  In this case, it isn't necessary (and not possible) to
calculate column widths.

Field names are substituted to be the same as "log" command.

There are a few limitations:

 - "binary file" message is not included in formatted output.
 - no data structure for multiple files. all lines are packed to single list.
2014-09-17 23:21:20 +09:00
Siddharth Agarwal
c1d6e28494 convert: add support to find git copies from all files in the working copy
I couldn't think of a better name for this option, so I stole the Git one in
the hope that anyone converting a Git repo knows what it means.
2014-09-12 12:28:30 -07:00
Siddharth Agarwal
476da59ea2 convert: add support to detect git renames and copies
Git is fairly unique among VCSes in that it doesn't record copies and renames,
instead choosing to detect them on the fly. Since Mercurial expects copies and
renames to be recorded, it can be valuable to preserve this history while
converting a Git repository to Mercurial. This patch adds a new convert option,
called 'convert.git.similarity', which determines how similar files must be to
be treated as renames or copies.
2014-09-12 11:23:26 -07:00
Siddharth Agarwal
1a1fc7e9e2 convert: add initial docs for git sources
Upcoming patches will add config options for git sources. This patch adds a
place to document them.
2014-09-12 10:17:56 -07:00
Matt Mackall
ef96dff15e color: change the debug output format
Before, the format was

 label(labeled text)  # single label
 [label1 label2](labeled text) # multiple

Now, it's

 [labels|labeled text]

..which should make things a bit more clear.
2014-09-19 12:51:15 -05:00
Jordi Gutiérrez Hermoso
3818f62593 color: enable debug option to show labels
This is a debug option for showing labels. This can be helpful for
knowing which labels are available for colouring or to see the output
when defining your own templates. A couple of tests are included.
2014-08-24 17:40:27 -04:00
Jordi Gutiérrez Hermoso
60df7a50e9 patch: enable diff.tab markup for the color extension
The following patch splits up changed lines along tabs (using
re.findall), and gives them a "diff.tab" label. This can be used by
the color extension for colorising tabs, like it does right now with
trailing whitespace.

I also provide corresponding tests.
2014-08-20 15:15:50 -04:00
Matt Mackall
95b134cbe5 merge with stable 2014-09-16 14:49:56 -05:00
Durham Goode
79319b785d revset: make parents() O(number of parents)
Strip executes a revset like this:

max(parents(_intlist('1234\x001235')) - _intlist('1234\x001235'))

Previously the parents() revset would do 'subset & parents' which iterates over
each item in the subset and checks if it's in parents.  subset is usually the
entire repo (a spanset) so this takes a while.

Reversing the parameters to be 'parents & subset' means the operation becomes
O(number of parents) instead of O(size of repo). It also means the result gets
evaluated immediately (since parents isn't a lazy set), but I think this is a
win in most scenarios.

This shaves 0.3 seconds off strip (amend/histedit/rebase/etc) for large repositories.

revset #0: parents(20000)
0) obsolete feature not enabled but 54243 markers found!
! wall 0.006256 comb 0.010000 user 0.010000 sys 0.000000 (best of 289)
1) obsolete feature not enabled but 54243 markers found!
! wall 0.000391 comb 0.000000 user 0.000000 sys 0.000000 (best of 4323)
2014-09-12 15:00:51 -07:00
FUJIWARA Katsunori
330bc07caa templater: add "diff" template function
"diff" allows to embed changes in the target revision into template
output, even if the command itself doesn't take "--patch" option

Combination of "[committemplate]" configuration and "diff" template
function can achieve the feature like issue231 ("option to have diff
displayed in commit editor buffer")

    http://bz.selenic.com/show_bug.cgi?id=231

For example, templating below can be used to add each "diff" output
lines "HG: " prefix::

      {splitlines(diff) % 'HG: {line}\n'}

This patch implements "diff" not as "a template keyword" but as "a
template function" to take include/exclude patterns at runtime.

It allows to specify target files of command (by -I/-X command line
options) and "diff" separately.
2014-08-28 22:45:36 +09:00
Matt Mackall
2bbf901e2c tests: fix breakage from locate deprecation 2014-09-16 11:08:14 -05:00
Matt Mackall
8a32bb8140 formatter: add pickle format
This gives convenient Python2 output. Python 3 users will need encoding=bytes.
2014-09-12 18:36:38 -05:00
Matt Mackall
aa7d73cbbb commands: add hidden -T option for files/manifest/status/tags
These commands have generic formatting support but no way to enable it
yet. When this feature is more fully developed, this flag will be unhidden.
2014-09-15 13:15:07 -05:00
Matt Mackall
7cc7319641 cmdutil: add json style to log-like commands
Sadly, this can't be done with the normal templater like we do with
XML due to JSON's inter-record comma rules.
2014-09-15 13:11:13 -05:00
Matt Mackall
be3bc4f866 formatter: make debug style match Python syntax 2014-09-12 19:06:11 -05:00
Matt Mackall
e7503a440b files: add new command unifying locate and manifest functionality 2014-09-12 18:32:46 -05:00
Augie Fackler
88def43f03 convert: enable deterministic conversion progress bar for svn
This produces slightly bad results when branches are in play, but
overall I think it's probably worthwhile. We might be able to do
better with branches somehow, but I haven't given it any thought.
2014-09-10 10:52:00 -04:00
Augie Fackler
8997a30abc convert: enable deterministic conversion progress bar for git 2014-09-10 10:51:46 -04:00
Augie Fackler
d625daaf03 test-convert-git.t: add a test of convert progress bars for git
We're about to enhance this support, so test the existing behavior so
the improved behavior is obvious in the next patch.
2014-09-10 11:04:29 -04:00
Augie Fackler
dae45e817f test-convert-svn-move.t: remove stray ' 2014-09-10 11:01:47 -04:00
Durham Goode
7244e005ee dirstate: add test for exceptions during updates
Adds a test that checks if the working copy parent and the working copy are in a
good state if an exception happens between the time the working copy parent is
set and the time the actual updates are recorded in the dirstate.
2014-09-05 15:36:56 -07:00
David Soria Parra
d24ddefeda tests: remove unnecessary apostrophe 2014-09-05 19:54:26 +02:00
anuraggoel
98bc0018a9 run-tests: added '--json' functionality to store test result in json file
This patch added a new functionality '--json'. While testing, if '--json'
is enabled then test result data gets stored in newly created "report.json"
file in the following format.

testreport ={
    "test-success.t": {
        "result": "success",
        "time": "2.041"
    }
    "test-failure.t": {
        "result": "failure",
        "time": "4.430"
    }
    "test-skip.t": {
        "result": "skip"
            "time": "3.754"
    }
}

Otherwise, if '--json' is enabled but json module was not installed then it
will raise an error "json module not installed".

This "report.json" file will further accessed by html/javascript file for
graph usage.
2014-09-08 16:41:00 +02:00
Sune Foldager
eb415860f8 changegroup: rename bundle-related functions and classes
Functions like getbundle and classes like unbundle10 really manipulate
changegroups and not bundles. A HG10 bundle is the same as a changegroup
plus a small header, but this is no longer the case for a HG2X bundle,
so it's better to separate the names a bit.
2014-09-02 12:11:36 +02:00
Mads Kiilerich
fae32dd0a3 comments: describe ancestor consistently - avoid 'least common ancestor'
"best" is as defined by mercurial.ancestor.ancestors: furthest from a root (as
measured by longest path).
2014-08-19 01:13:10 +02:00
David Soria Parra
610c9c1bff rebase: add a deprecated -i/--interactive flag
A common mistake can be to type 'hg rebase -i' to discover interactive history
editing. We add a -i/--interactive flag as discussed in the sprint and deprecate
it right away, but hint people using it to use histedit instead.
2014-09-01 11:48:55 +02:00
Augie Fackler
54df1661c3 clone: provide sample username = config entry in .hg/hgrc (issue4359)
Some users clone from a server before ever running 'hg config --edit',
so they don't see our helpful template for things like enabling the
username. Attempt to give them some helpful guidance.
2014-09-09 17:16:24 -04:00
Augie Fackler
2cc1ba92e0 test-acl: alter sed construct to avoid changes in .hg/hgrc formatting
A future patch is going to add some extra commented-out boilerplate to
the top of .hg/hgrc during clone. In order to make this test not
require regular updates, switch to searching for [hooks] or [acl] and
print file from the first match to that pattern.
2014-09-09 16:51:21 -04:00
Augie Fackler
a0fd83333c merge with stable 2014-09-09 13:47:50 -04:00
Kevin Bullock
6cd9563e40 merge with stable 2014-09-07 11:46:11 -05:00
Augie Fackler
f41d193435 merge with stable 2014-09-04 09:59:23 -04:00
Mads Kiilerich
9f8f9204ca tests: improve test coverage of branch command and existing branches 2014-08-29 12:17:53 +02:00
Gregory Szorc
6f5ee93aca run-tests: make --interactive work with --view 2014-08-31 12:22:44 +02:00
Pierre-Yves David
1f9120a498 test-ancestor: add a test for ancestor with ancestry within the initset
I was wondering if revisions in the initial set that are still ancestors of other
elements in the initial set were yielded by `changelog.ancestors`. I now have my
answer (they do) and Mercurial has a new test.
2014-08-30 11:39:15 +02:00
Pierre-Yves David
cb0b9120c1 bundle2: pull obsmarkers relevant to the pulled set through bundle2
We use the new `obsheads` argument to retrieve them in a bundle2 part at the
same time as the changegroup.
2014-08-26 12:47:41 +02:00
Pierre-Yves David
81f365f70c push: only push obsmarkers relevant to the "pushed subset"
We should only exchange obsolete markers related to the changesets
that are being exchanged. For example, if `A'` is a successor of `A`,
we do not want to push the marker if we are not exchanging
`A'`. Otherwise `A` would disappear without a successor, leading to confusion
for both users and the evolution mechanism.

Therefore we now exchange only the markers relevant to the subset of nodes
involved in the push (the nodes themselves may be already common but were
selected by --rev (or the lack of --rev)).

Note that all selected markers are still exchanged on each push. We do
not have a discovery protocol for markers in core yet. Such discovery
would save us the exchange of markers known on both side.
2014-08-20 01:15:09 -07:00
Pierre-Yves David
78eab12f44 test-obsolete: sort the output of debugobsolete
The set of relevant markers is currently unordered. Therefore the
markers will be added in arbitrary order. We sort the list of markers
beforehand to ensure stable output for testing.
2014-08-20 19:47:35 -07:00
Pierre-Yves David
56469dc57f test-obsolete: change a marker so it is relevant to the exchanged set
We are going to only exchange markers relevant to the exchanged
changesets. So we need to change this marker to use a known changeset as
a successor instead of a precursor.
2014-08-20 19:42:33 -07:00