Commit Graph

2965 Commits

Author SHA1 Message Date
Yuya Nishihara
317fa85948 paths: port to generic templater
Embedded passwords are masked only in plain output because we'll want raw
values in machine-readable format such as JSON. For custom template, we can
add a filter to mask passwords (e.g. "{url|hidepassword}").

path.rawloc field is called as "url" than "path" because we have "pushurl"
sub-option. Also, "name" and "url" are not allowed as sub-options as they
conflict with the field names.
2015-12-13 22:09:57 +09:00
Yuya Nishihara
5c49dab973 paths: merge conditions that select visibility of fields
Truth table (extracted from the original implementation):

  search quiet  name path subopt
  ------ -----  ---- ---- ------
  f      f      T    T    T
  f      T      T    f    f
  T      f      f    T    f
  T      T      f    f    f
2015-12-13 23:01:19 +09:00
Yuya Nishihara
7e97000e2d paths: use single loop for both search=None|pattern cases
This will help porting to the formatter API. This patch adds test for empty
pathitems to make sure "hg paths" never say "not found!".
2015-12-13 22:02:32 +09:00
Yuya Nishihara
a4711dcd63 paths: reorder else clause for readability of subsequent patches
This prepares for porting to the formatter API. Future patches will use a
single loop to handle both search=None|pattern cases because formatter output
should be the same. "pathitems" will be switched instead.
2015-12-13 21:55:57 +09:00
Yuya Nishihara
14e64b757a paths: drop ui.status label from output of "hg paths name"
We just need to not print path if --quiet. ui.status label is unwanted.
2015-12-13 21:54:00 +09:00
Matt Harbison
f079641319 summary: print unstable, bumped and divergent as unconditionally plural
This aligns with the unconditional plural output for the update line contents,
as well as the incoming/outgoing bookmarks line.  It also matches the message
in evolve's summary hook as of 4f83b2d2d20d.  (Though I thought this was removed
recently?)
2016-01-11 21:00:29 -05:00
Bryan O'Sullivan
9adb9fb244 commands: get rid of empty try/finally block from _dograft
This diff is purely an indentation change to clean up a block that
was kept in place to make 9e5d088542ab easier to read.
2016-01-11 09:49:48 -08:00
Bryan O'Sullivan
eff9c7d54a commands: get rid of empty try/finally block from _dobackout
This diff is purely an indentation change to clean up a block that
was kept in place to make 4645e52058b4 easier to read.
2016-01-11 09:49:47 -08:00
Bryan O'Sullivan
459e92e905 commands: get rid of empty try/finally block from import_
This diff is purely an indentation change to clean up a block that
was kept in place to make 760a55541ca3 easier to read.
2016-01-11 09:49:39 -08:00
Laurent Charignon
95ad56f2f0 debugignore: find out why a file is being ignored (issue4856)
This patch adds a capability to hg debugignore: to explain why a given file is
being ignores by mercurial. We display the filename, line and linenumber of the
rule that lead us to ignore the file.
2016-01-05 07:47:08 -08:00
Laurent Charignon
f5214fc7b3 debugignore: find out if a file is being ignored
Before this patch debugignore was just displaying the list of ignore patterns.
This patch makes it support a list of filename as argument and tells the user
if those given files are ignored or not.
2016-01-05 07:47:08 -08:00
timeless
4e03c1691c clone: move bookmarks and checkouts before pull help
The bookmark/checkout help actually split the pull help.
The subsequent verbose container is talking about pull too.
This change puts the pull help back together again.
2016-01-05 19:59:21 +00:00
timeless
58c3371f4c log: help provide sort by date example 2016-01-06 07:55:57 +00:00
timeless
c27e8dde2d log: mention ordering
a user complained that hg help log did not hint how to sort
the output by date
2016-01-06 19:29:45 -05:00
Siddharth Agarwal
0efe3372e4 origpath: move from cmdutil to scmutil
This is a lower-level function so it doesn't need to be in cmdutil, and putting
it here avoids a bunch of potential import cycle issues.
2016-01-02 03:02:57 -08:00
timeless
ebb1d48658 cleanup: remove superfluous space after space after equals (python) 2015-12-31 08:16:59 +00:00
timeless
ea4a7888cc resolve: suggest the next action
Expose afterresolvedstates to allow graft and similar to
suggest a message when resolving results in no unresolved
files.

If there isn't a matching state in afterresolvedstates,
then if verbose, suggest commiting.
2015-12-24 19:25:44 +00:00
timeless
04b3592b35 parents: correct help revset replacements
Implementing `hg parents -r REV FILE` correctly is hard.

The output can be 0, 1, or 2 revs.

First, you can't use parents(), because it sorts its output...

Consider:
echo $a
echo par@rev: `hg log -r "parents($a)" -q`
echo p12@rev: `hg log -r "p1($a)+p2($a)" -q`
echo parents: `hg parents -q -r $a`

(Merge 1 into 0)
3
par@rev: 0:d9612eafe8ec 1:070fe4290d06
p12@rev: 0:d9612eafe8ec 1:070fe4290d06
parents: 0:d9612eafe8ec 1:070fe4290d06

(Merge 4 into 5)
6
par@rev: 4:db73392995c3 5:c26e7dd67644
p12@rev: 5:c26e7dd67644 4:db73392995c3
parents: 5:c26e7dd67644 4:db73392995c3

(Merge 7 into 8)
9
par@rev: 7:d84f47462f70 8:9597bcab36e0
p12@rev: 8:9597bcab36e0 7:d84f47462f70
parents: 8:9597bcab36e0 7:d84f47462f70

You also can't use parents or/p1/p2 alone with a set, as in:
-r "parents(::REV and file(FILE))"
-r "parents(::REV - REV and file(FILE))"
... because each will return all parents for each candidate revision,
and the :: gives too many candidates.

Thus, we need a max and a p1/p2.

Also, anything of this form:
max(::REV - REV and file(FILE))
... is wrong, because max will return only one revision, and for
a proper parents, you need to return two occasionally.

Lastly, it doesn't help that `hg parents -r REV FILE` is buggy
due to a quirk in filelogs.

Here's a repository to consider when evaluating whether your
revset is correct:

$ hg log -G --template '{rev} {files}\n';
@  10 a
|
o    9 a b
|\
| o  8 a
| |
o |  7 a
| |
+---o  6 b
| |/
| o  5 b
| |
o |  4 b
| |
+---o  3
| |/
+---o  2
| |/
| o  1 b
|
o  0 a

revs 4 and 5 create a conflict.
The conflict is resolved in the same way by both 6 and 9.

You would hope that parents around 9/10 would point to 9,
but `hg parents` will point to 6 due to the aforementioned bug.

Here's the winning solution test script and its output.

echo $a;
echo rp12-max: `hg log -r "max(::p1($a) and file(b)) + max(::p2($a) and file(b))" -q` 2> /dev/null;
echo expected: `hg parents -q -r $a b` 2> /dev/null;

Note that for 10, the output differs, but again, this is because
of the aforementioned bug. The rp12-max output is "correct",
whereas "expected" is just an unfortunate bug. The abort output
is due to something else. I'm not sure why someone thought it
was important to abort to stdio instead of stderr, but that's
really not my problem here.

10
rp12-max: 9:184ebefc2fce
expected: 6:dd558142b03f
9
rp12-max: 5:c26e7dd67644 4:db73392995c3
expected: 5:c26e7dd67644 4:db73392995c3
8
rp12-max: 5:c26e7dd67644
expected: 5:c26e7dd67644
7
rp12-max: 4:db73392995c3
expected: 4:db73392995c3
6
rp12-max: 5:c26e7dd67644 4:db73392995c3
expected: 5:c26e7dd67644 4:db73392995c3
5
rp12-max: 1:070fe4290d06
expected: 1:070fe4290d06
4
rp12-max:
abort: 'b' not found in manifest!
expected:
3
rp12-max: 1:070fe4290d06
expected: 1:070fe4290d06
2
rp12-max: 1:070fe4290d06
expected: 1:070fe4290d06
1
rp12-max:
abort: 'b' not found in manifest!
expected:
0
rp12-max:
abort: 'b' not found in manifest!
expected:
2015-12-23 19:07:34 +00:00
Yuya Nishihara
2b215bf881 push: specify default-push and default as fallback paths
The next patch will remove the "default-push" hack from ui.paths so that
ui.paths["default"].pushurl can be different from "default-push".
2015-12-26 16:12:28 +09:00
timeless
08caed46f0 annotate: mention that -n is suppressed in help 2015-12-17 14:56:14 +00:00
timeless
c5a20df087 commands: split notes into note containers 2015-12-22 06:03:00 +00:00
timeless
c754b0afd2 remove: quote --force in never deletes note
Split Note into a note container
2015-12-22 06:02:01 +00:00
timeless
22a7897143 import: reword no hunks partial note
Split Note into a note container
2015-12-22 06:03:10 +00:00
timeless
fd5cc0f542 merge: reword help to use See help resolve 2015-12-22 05:46:23 +00:00
timeless
a433b637d1 commands: the first word of each note should be capital or hg 2015-12-22 02:24:16 +00:00
timeless
777dbfe303 commands: consistently indent notes 3 spaces
most notes have 3 spaces for indentation, these had 2...
2015-12-18 06:33:48 +00:00
Gregory Szorc
d83e377daa commands: use revlog._deltachain in debugdeltachain
We have a nice API now. Use it.

This does mean we introduce an extra index lookup for each revision.
Considering this is a debug command, the overhead should be acceptable.
We could add the chain size to revlog._deltachain(). However, that
feels like avoidable overhead.
2015-12-20 19:02:02 -08:00
timeless
78ff92a147 diff: clarify comparison as first parent 2015-12-18 18:52:25 +00:00
timeless
8634803214 branch: reword help text
We're not necessarily talking about *the* active branch,
just any old branch.
2015-12-17 14:57:20 +00:00
timeless
c8d8d5d5ad archive: adjust help text 2015-12-17 14:56:32 +00:00
timeless
b6b262b427 annotate: add missing period to help 2015-12-17 14:54:47 +00:00
timeless
81c1e01972 addremove: make help match add 2015-12-17 14:54:20 +00:00
timeless
86a42ddbf7 add: mention .hgignore in help 2015-12-17 14:53:40 +00:00
timeless
ef7cfdfced bundle: warn for --base with --all 2015-12-17 15:05:25 +00:00
timeless
3db2ef2e04 bundle: fix error for --all with destination
Before it complained about --base
2015-12-17 15:03:45 +00:00
timeless
82d910c7aa bundle: fix grammar in help text 2015-12-17 14:59:11 +00:00
timeless
9c4b396c3c bundle: clarify help text
The file might not be compressed; the interactions between
-a, --base, and a named or default repository weren't clear.
2015-12-17 14:58:52 +00:00
Thu Trang Pham
3d4e42b9c9 tags: mention --quiet switch in help (issue4920) 2015-12-17 15:23:36 -08:00
timeless
4eb5187268 import: reorder help text
Try to place key concepts early+together.
2015-12-15 07:57:04 +00:00
timeless
ff823e878b import: add word to help text 2015-12-15 07:56:03 +00:00
timeless
a16cbf7613 import: refactor exact flag 2015-12-15 07:54:01 +00:00
Laurent Charignon
4309e7ad61 summary: add troubles list to the output of hg summary
This patch adds troubles information to the output of hg summary.
Example line displayed in hg summary:
unstable: 1 changeset
2015-12-14 11:19:48 -08:00
Gregory Szorc
56babdcfc2 help: pass subtopic into help()
Now that we have multiple directories where help topics can live,
we need a mechanism to access them. We already use "." to
separate topic from section. So it seems logical to also use "." to
denote the sub-directory of a topic.

This patch teaches the help command to parse out the possible
sub-topic and pass it to the help system.
2015-12-13 11:04:45 -08:00
Yuya Nishihara
7b095d1256 commandserver: cut import cycle by itself
We generally make modules importable from the front-end layer, dispatch ->
commands -> x. So the import cycle to dispatch should be resolved by the
commandserver module.
2015-11-24 23:03:54 +09:00
Augie Fackler
0a19647501 merge: have merge.update use a matcher instead of partial fn
This is relatively rarely used functionality, but migrating this to a
matcher will make future work on narrow clones more feasible.
2015-12-14 18:54:03 -05:00
Matt Mackall
3bbe98aeff merge with stable 2015-12-11 17:45:19 -06:00
Yuya Nishihara
e95ba280a6 paths: include #fragment again
Since 3be994f0f015, #fragment was missing in "hg paths" output because
path.loc was changed to a parsed URL. "hg paths" should use path.rawloc to
show complete URLs.
2015-12-07 21:42:50 +09:00
timeless
0d1432229b parents: provide equivalent revsets in help 2015-12-08 20:21:08 +00:00
Siddharth Agarwal
4e11ac7ea5 resolve: restore .orig only after merge is fully complete (issue4952)
Previously, we'd restore the .orig file after the premerge is complete but
before the merge was complete. This would lead to the .orig file potentially
containing merge conflict markers in it, as a leftover from the last merge
attempt.
2015-11-13 15:56:02 -08:00
timeless
4676c472c0 commands: use Oxford comma (help clone) 2015-11-30 19:29:46 +00:00