Commit Graph

2947 Commits

Author SHA1 Message Date
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
Gregory Szorc
e2ea48dfff ui: support declaring path push urls as sub-options
Power users often want to apply per-path configuration options. For
example, they may want to declare an alternate URL for push operations
or declare a revset of revisions to push when `hg push` is used
(as opposed to attempting to push all revisions by default).

This patch establishes the use of sub-options (config options with
":" in the name) to declare additional behavior for paths.

New sub-options are declared by using the new ``@ui.pathsuboption``
decorator. This decorator serves multiple purposes:

* Declaring which sub-options are registered
* Declaring how a sub-option maps to an attribute on ``path``
  instances (this is needed to `hg paths` can render sub-options
  and values properly)
* Validation and normalization of config options to attribute
  values
* Allows extensions to declare new sub-options without monkeypatching
* Allows extensions to overwrite built-in behavior for sub-option
  handling

As convenient as the new option registration decorator is, extensions
(and even core functionality) may still need an additional hook point
to perform finalization of path instances. For example, they may wish
to validate that multiple options/attributes aren't conflicting with
each other. This hook point could be added later, if needed.

To prove this new functionality works, we implement the "pushurl"
path sub-option. This option declares the URL that `hg push` should
use by default.

We require that "pushurl" is an actual URL. This requirement might be
controversial and could be dropped if there is opposition. However,
objectors should read the complicated code in ui.path.__init__ and
commands.push for resolving non-URL values before making a judgement.

We also don't allow #fragment in the URLs. I intend to introduce a
":pushrev" (or similar) option to define a revset to control which
revisions are pushed when "-r <rev>" isn't passed into `hg push`.
This is much more powerful than #fragment and I don't think #fragment
is useful enough to continue supporting.

The [paths] section of the "config" help page has been updated
significantly. `hg paths` has been taught to display path sub-options.

The docs mention that "default-push" is now deprecated. However, there
are several references to it that need to be cleaned up. A large part
of this is converting more consumers to the new paths API. This will
happen naturally as more path sub-options are added and more and more
components need to access them.
2015-12-05 21:11:04 -08:00
Gregory Szorc
fb6cc829b7 ui: store pushloc as separate attribute
The magic @property is going to interfere with the ability to print
path sub-options. We only access it in one location and it is trivial
to in-line, so do that.
2015-12-06 11:49:02 -08:00
Gregory Szorc
d25e6f2fdc commands: add debugdeltachain command
We have debug commands for displaying overall revlog statistics
(debugrevlog) and for dumping a revlog index (debugindex). As part
of investigating various aspects of revlog behavior and performance,
I found it important to have an understanding of how revlog
delta chains behave in practice.

This patch implements a "debugdeltachain" command. For each revision
in a revlog, it dumps information about the delta chain. Which delta
chain it is part of, length of the delta chain, distance since base
revision, info about base revision, size of the delta chain, etc. The
generic formatting facility is used, which means we can templatize
output and get machine readable output like JSON.

This command has already uncovered some weird history in
mozilla-central I didn't know about. So I think it's valuable.
2015-12-05 23:37:46 -08:00
Gregory Szorc
6be2ff7286 commands.debugindexdot: use cmdutil.openrevlog()
This pattern is used for all the other debug* commands that operate
on revlogs. debugindexdot is an outlier. Make it conform.
2015-12-05 21:40:38 -08:00
Gregory Szorc
68fc062c6f commands: unify argument handling for revlog debug commands
The same 3 options are used in a few locations and I'm about to
add another. Might as well consolidate the pattern.
2015-12-05 21:47:39 -08:00
Yuya Nishihara
3e4bbbe974 commit: fix rest syntax of examples
This fixes the formatting of help/commit page and silence test-gendoc.t.
2015-12-06 17:16:37 +09:00
Matt Harbison
378739c9cd commit: adjust the quoting in the examples to be Windows friendly
We should probably avoid strong quotes around command line args in the examples,
since cmd.exe doesn't recognize them, and it will surprise a user who cargo
cults them.  I don't see a way to make a rule for this, since strong quoting is
OK inside command line args, like within revsets.
2015-12-05 22:19:48 -05:00
Augie Fackler
31fc3d117c commit: add some help examples (issue4963)
Includes documenting --date now, which resolves the above issue.
2015-12-04 15:24:05 -05:00
Yuya Nishihara
78ebbc20b2 graphlog: move creation of workingdir-parent nodes to displaygraph()
Future patches will make a node symbol templatable. Because arguments of a
templatekw function are repo and ctx, "showparents" list will have to be
built from a repo object by that function.
2015-11-14 16:45:15 +09:00
FUJIWARA Katsunori
f8fa1a1ece commands: execute checkunfinished and bailifchanged inside wlock scope
Before this patch, "hg import" executes below before acquisition of
wlock:

  - cmdutil.checkunfinished()
  - cmdutil.bailifchanged()

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

To avoid this issue, this patch executes 'cmdutil.checkunfinished()'
and 'cmdutil.bailifchanged()' inside wlock scope of "hg import".
2015-12-02 03:12:08 +09:00
FUJIWARA Katsunori
3aef0e6f75 commands: widen wlock scope of graft for consitency while processing
Before this patch, "hg graft" executes below before acquisition of
wlock.

  - cmdutil.checkunfinished()
  - cmdutil.bailifchanged()
  - repo.dirstate.parents() via 'repo["."]'
  - unlinking '.hg/graftstate'

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

This patch widens wlock scope of "hg graft" for consitency while
processing.
2015-12-02 03:12:07 +09:00
FUJIWARA Katsunori
9b4fb6e7f8 commands: make backout acquire locks before processing
Before this patch, "hg backout" executes below before acquisition of
wlock.

  - cmdutil.checkunfinished()
  - cmdutil.bailifchanged()
  - repo.dirstate.parents()

It may cause unintentional result, if another command runs parallelly
(see also issue4368).

In addition to it, "hg backout" refers changelog for purposes below
without acquisition of store lock (slock), and it may cause
unintentional result, if store is updated parallelly.

  - show and update to the revision by 'repo.changelog.tip()'

  - examine for "created new head" by 'repo.branchheads()' and
    'cmdutil.commitstatus()'

To avoid this issue, this patch makes "hg backout" acquire wlock and
slock before processing.
2015-12-02 03:12:07 +09:00
FUJIWARA Katsunori
401c1d7800 commands: make commit acquire locks before processing (issue4368)
Before this patch, "hg commit" (process A) executes steps below:

  1. get current branch heads via 'repo.branchheads()'
     - cache 'repo.changelog'
  2. invoke 'repo.commit()'
  3. acquire wlock
     - invalidate 'repo.dirstate'
  4. access 'repo.dirstate'
     - re-read '.hg/dirstate'
     - check validity of parent revisions with 'repo.changelog'
  5. invoke 'repo.commitctx()'
  6. acquire store lock (slock)
     - invalidate 'repo.changelog'
  7. do committing
  8. release slock
  9. release wlock
 10. check new branch head (via 'cmdutil.commitstatus()')

If acquisition of wlock at (3) above waits for another "hg commit"
(process B) or so running parallelly to release wlock, process A
causes creating orphan revision, because:

  - '.hg/dirstate' refers the revision, which is newly added by
    process B, as its parent

  - but already cached 'repo.changelog' doesn't contain such revision

  - therefore, validating parents of '.hg/dirstate' at (4) above
    replaces such revision with 'nullid'

Then, process A creates "orphan" revision, of which parent is "null"
revision.

In addition to it, "created new head" may be shown at the end of
process A unintentionally, if store is updated parallelly, because
both getting branch heads (1) and checking new branch head (10) are
executed outside slock scope.

To avoid this issue, this patch makes "hg commit" acquire wlock and
slock before processing.

This patch resolves the issue between "hg commit" processes, but not
one between "hg commit" and other commands. Subsequent patches resolve
the latter.

Even after this patch, there are still corner case problems below:

  - filecache may overlook changes of '.hg/dirstate', and it causes
    similar issue (see below for detail)

    https://bz.mercurial-scm.org/show_bug.cgi?id=4368#c10

  - 3rd party extension may cause similar issue, if it directly uses
    'repo.commit()' without acquisition of wlock and slock

    This can be fixed by acquisition of slock at the beginning of
    'repo.commit()', but it seems suitable for "default" branch

    In fact, acquisition of slock itself is already introduced at
    "default" branch by ec227b188932, but acquisition is not at the
    beginning of 'repo.commit()'.

This patch also changes some tests:

  - test-fncache.t needs this tricky wrapping, to release (= forced
    failure of) wlock certainly

  - order of "hg commit" output is changed by widening scope of locks,
    because some hooks are fired after releasing wlock
2015-12-02 03:12:07 +09:00
Christian Delahousse
2a005d816a dirstate: change debugrebuilddirstate --minimal to use dirstate.rebuild
When debugrebuilddirstate --minimal is called, rebuilding the dirstate was done
outside of the appropriate rebuild function. This patch makes
debugrebuilddirstate use dirstate.rebuild.

This was done to allow our extension to become aware debugrebuilddirstate
--minimal
2015-11-30 11:23:15 -08:00
timeless
3d618fe024 graft: improve --continue abort message
before, if you ran hg graft --user ... --date ... --log ... revs,
and if it failed, it would suggest "hg graft --continue",
but if you did that, your --user / --date / --log options
were lost, because they were not persisted anywhere...
2015-12-02 06:33:52 +00:00
timeless
9742970292 summary: mention graft 2015-12-02 06:31:12 +00:00
Augie Fackler
840125d439 commands: inline definition of localrepo.parents() and drop the method (API)
localrepo.parents() has relatively few users, and most of those were
actually implicitly looking at the wctx, which is now made explicit
via repo[None].
2015-11-11 20:07:15 -05:00
Mike Edgar
8e7be9d666 commit: preserve extra when amending with commit --amend
The new extra propagation needs to be accounted for in cmdutil.amend,
when checking for a no-changes fast-path.
2015-11-28 04:11:57 -05:00