Commit Graph

2636 Commits

Author SHA1 Message Date
Matt Mackall
bae7de95b0 heads: modernize documentation (issue3992)
The old docs emphasized topological heads rather than branch heads and
incorrectly defined branch heads as not having children rather than
descendants.
2013-07-21 18:45:42 -05:00
Jordi Gutiérrez Hermoso
dc821f9523 commit: enable --secret option
At the moment, creating secret commits is slightly cumbersome. They
can either be created by changing the default commit phase to secret
or by doing `hg phase --secret --force`. Both of these make secret
commits appear to be like some kind of advanced feature.

Secret commits, however, should be a convenient feature for people who
want to work on a private branch without affecting anyone else. There
should therefore be a prominent and convenient method for creating
secret commits.

Since the default phase is draft and there is no need to use --force
to go from a secret phase to any other phase, this patch
intentionally does not add --draft and --public options.
2013-07-11 13:11:41 -04:00
Florence Laguzet
2a64618669 merge: deprecate the --force option
The --force option in merge does not make what people think it does so
it may not be visible to everyone.

I have local changes and want to pull one's changes which made 2 heads.
The --force option in help says

 -f --force      force a merge with outstanding changes

so I can expect that I can use it to force the merge and commit it in my
local repository without taking my local changes into account. But
merging with -f keeps local changes and "add" them: they must be
committed or reverted before doing the merge commit. The merge -f cannot
be reverted so it leads my repository in a bad state: cannot commit
merge and don't want to revert/commit local changes yet.

Message in help have been updated to emphasize the fact that local
changes are included in the merge.
2013-07-17 23:58:04 +02:00
Siddharth Agarwal
b40e1d442a version: bump copyright year 2013-07-17 17:34:30 -07:00
Martin Geisler
d2aa05d2bf rollback: add reference to "hg commit --amend"
Now that rollback is deprecated (yay!) users might need a pointer to
the alternative for 99% of the cases where I used rollback.
2013-07-17 10:49:34 +02:00
Matt Mackall
90ddfc6b4b rollback: mark as deprecated 2013-07-16 17:10:26 -05:00
Matt Mackall
d487ab0f65 tip: deprecate the tip command 2013-07-11 19:29:23 -05:00
Matt Mackall
14881de1b1 tag: remove incorrect reference to tip 2013-07-11 19:28:54 -05:00
Matt Mackall
a7f8535149 log: remove tip from example 2013-07-11 19:28:26 -05:00
Matt Mackall
8101748b15 cat: remove incorrect reference to tip 2013-07-11 19:28:01 -05:00
Siddharth Agarwal
4a9d798403 summary: use missing ancestors algorithm to find new commits
For a repository with around 520,000 commits and 190,000 files, this reduces
the time hg summary takes from 5.5 seconds to 2.75.
2013-07-15 15:19:43 -07:00
Simon Heimberg
9bef074106 summary: remove passing of rev because summary does not have this
The command summary does not have a rev argument, so passing this results
is None always. Therefore pass None explicitly.
2012-11-06 00:22:56 +01:00
Durham Goode
f9e0cf8458 parents: change parents command to use filectx
Changes the parents command to use filectx to look up the change node
instead of doing it manually.  This allows extensions to modify the
file-to-commit relationship behind the filectx api.
2013-06-18 13:05:16 -07:00
Matt Mackall
1035a87704 merge with stable 2013-06-07 16:59:59 -05:00
Matt Mackall
3491238eed merge with stable 2013-06-01 17:19:00 -05:00
Simon King
ca4986a596 graft: refuse to commit an interrupted graft (issue3667) 2013-05-30 22:32:10 +01:00
Matt Mackall
ae59675587 merge with stable 2013-05-23 17:52:21 -05:00
Matt Mackall
666687bde2 amend: complain more comprehensibly about subrepos 2013-05-23 17:39:33 -05:00
Matt Mackall
10bc3570e7 help: fix role/option confusion in RST
RST's role syntax means something different sometimes when it's in
some places that are poorly documented and vary betwen minirst and
docutils. Line wrapping will thus sometimes break everything.
2013-05-21 15:23:50 -05:00
Mike Williams
946c7811c1 help: stop documentation markup appearing in generated help
Markup for links to mercurial commands is appearing in the help
documentation.

This patch fixes the markup so mercurial command reference links are
correctly generated in the help documentation.
2013-05-15 22:19:12 +01:00
Yuya Nishihara
7976fca292 branch: strip whitespace before testing known branch name
Because dirstate._branch() strips leading/trailing spaces from .hg/branch,
"hg branch ' foo '" should abort if branch "foo" exists in another head.

tag command had a similar bug and fixed by 11d102903884.
2013-05-07 23:49:03 +09:00
Iulian Stana
b1c3535a9b commit: amending with --close-branch (issue3445)
You can't close a branch that hasn't got a head.
newbranch + commit --close-branch must fail
newbranch + commit + commit --amend --close-branch must fail

You must not be allowed to close a branch that is not defined.
2013-05-02 19:36:47 +03:00
Sean Farley
a7c7655a58 bookmarks: fix bug that activated a bookmark even with -r passed
If the current revision was the target revision of -r, then the bookmark would
be active. Test cases have been updated accordingly.
2013-05-01 15:24:21 -05:00
Sean Farley
a1b3b895c9 bookmarks: resolve divergent bookmark when moving across a branch
This patch resolves a single divergent bookmark if a divergent bookmark exists
in the target revision and it current bookmark is not an ancestor of the target
revision, else it would already be handled by the previous patch in this
series.

Test coverage is added.
2013-04-30 21:12:49 -05:00
Sean Farley
b0f6662132 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
This patch is a follow-up to 00b2764d68e4 that resolves divergent bookmarks
between the to-be-forwarded bookmark MARK and the new descendant. This
situation can happen when pulling new changesets, updating to the divergent
bookmark, abandoning the previous changesets with strip, and then moving MARK
to MARK@N.

Test coverage is added.
2013-05-01 15:31:39 -05:00
Matt Mackall
4c93c130ae merge with stable 2013-05-21 15:32:15 -05:00
Bryan O'Sullivan
5acd0ede31 summary: augment output with info from extensions 2013-05-14 11:23:15 -07:00
Matt Mackall
1fb1e9a700 merge with stable 2013-05-16 16:20:10 -05:00
Benoit Boissinot
a898b587b8 bundle-ng: add bundlecaps argument to getbundle() command 2013-02-09 23:42:03 +01:00
Kevin Bullock
025c39700e merge with stable 2013-05-13 13:02:01 -05:00
Kevin Bullock
21ed6a41e7 bookmarks: allow bookmark command to take multiple arguments
This change allows setting or deleting multiple bookmarks at once. If more than
one is being set and --inactive is not given, the first one is made active.
2013-05-02 21:28:18 -05:00
Pierre-Yves David
e661ab7a6c import: inline checkexact function
We have a sngle call now, no need to make it a function.
2013-04-17 10:25:14 +02:00
Pierre-Yves David
376dafed94 import: factor out checkexact
The two calls are strictly identical. We can simply move it after the if/else
clause.
2013-04-17 10:22:28 +02:00
FUJIWARA Katsunori
b29ea06623 summary: clear "commonincoming" also if branches are different
Before this patch, "commonincoming" calculated by
"discovery.findcommonincoming()" is cleared, only if "default" URL
without branch part (tail "#branch" of URL) differs from
"default-push" URL without branch part.

But common revisions in "commonincoming" calculated for a branch
doesn't include ones for another branch, even if URLs without branch
part are same. The result of "discovery.findcommonoutgoing()"
invocation with such "commonincoming" becomes incorrect in some cases.

This patch clears "commonincoming", also if branch part of "default"
differs from one of "default-push".

To avoid redundant looking up:

  - "ui.expandpath('default')" and "ui.expandpath('default-push',
    'default')" are not compared directly, even though they contain
    branch information, because they are not yet normalized by
    "hg.parseurl()": tail "/" of path, for example

  - "commonincoming" is not cleared, if branch isn't specified in
    "default" URL, because such "commonincoming" contains common
    revisions for all branches

This patch also tests "different path, same branch" pattern to check
careless degrading around comparison between source and destination.
2013-04-09 23:40:11 +09:00
FUJIWARA Katsunori
a5e9088b00 summary: make "incoming" information sensitive to branch in URL (issue3830)
Before this patch, "incoming" information of "hg summary --remote" is
not sensitive to the branch specified in the URL of the destination
repository, even though "hg pull"/"hg incoming" are so.

Invocation of "discovery.findcommonincoming()" without "heads"
argument treats revisions on branches other than the one specified in
the URL as incoming ones unexpectedly.

This patch looks head revisions, which are already detected by
"hg.addbranchrevs()" from URL, up against "other" repository, and
invokes "discovery.findcommonincoming()" with list of them as "heads"
to limit calculation of incoming revisions.
2013-04-09 23:40:11 +09:00
FUJIWARA Katsunori
70663e300c summary: make "outgoing" information sensitive to branch in URL (issue3829)
Before this patch, "outgoing" information of "hg summary --remote" is
not sensitive to the branch specified in the URL of the destination
repository, even though "hg push"/"hg outgoing" are so:

Invocation of "discovery.findcommonoutgoing()" without "onlyheads"
argument treats revisions on branches other than the one specified in
the URL as outgoing ones unexpectedly.

This patch looks head revisions, which are already detected by
"hg.addbranchrevs()" from URL, up against local repository, and
invokes "discovery.findcommonoutgoing()" with list of them as
"onlyheads" to limit calculation of outgoing revisions.
2013-04-09 23:40:10 +09:00
Mads Kiilerich
b81e3cdb96 debugrebuildstate: rename to debugrebuilddirstate
There is a lot of state, but this command is for rebuilding the dirstate.
2013-04-15 01:41:47 +02:00
Mads Kiilerich
a855980324 debugstate: rename to debugdirstate
There is a lot of state, but this command is for debugging the dirstate.
2013-04-15 01:41:27 +02:00
Mads Kiilerich
2c609377a2 debugrebuildstate: clarify that rev can't be specified without -r
-r has a default value of '' in the command line. The function default value of
'tip' is thus never used and any attempt at specifying revisions without -r
will fail.

It seems like then intended behavior was that 'hg debugrebuildstate' without
any parameters should set the parents to tip. That would be very confusing now
when the command primarily is used to recover from incorrect stat info.

It is apparently undocumented that '' is the same as '.' ... unless it is
passed in a place where revsets are used.
2013-04-15 01:39:02 +02:00
Mads Kiilerich
747e73f27d export: export working directory parent by default
A common usecase for export is to preview the patch that will be patchbombed or
to see what changed in a revision found by bisect. Showing the working
directory parent is thus a useful and obvious default.
2013-02-11 00:43:12 +01:00
Mads Kiilerich
7c13eeb821 commit: allow closing "non-head" changesets
Backout 308a153b9120. The changeset prevented closing non-head changesets but
did not provide any rationale or test case and I don't see what value it adds.
Users might have their reasons to commit something anywhere - and close it
immediately.

And contrary to the comment that is removed: The topo heads set is _not_
included in the branch heads set of the current branch. It do not include
closed topological heads.

The change thus prevented closing commits on top of closing commits. A valid
usecase for that is to merge closed heads to reduce the number of topological
heads.

The only existing test coverage for this is the failing double close in
test-revset.t. It was added in dc0e42c06b4e and seems to not be intentional.
2013-04-10 13:12:24 +02:00
Brodie Rao
3d16726725 amend: support amending merge changesets (issue3778) 2013-02-08 21:08:34 +00:00
Mads Kiilerich
c0e7f36590 tag: clarify cryptic error message when tagging null revision 2013-04-11 14:44:22 +02:00
Bryan O'Sullivan
738dd167db debuglabelcomplete: compute active branch heads correctly
The previous computation was simply wrong.
2013-04-09 09:40:40 -07:00
Siddharth Agarwal
7b731630aa graft: use missing ancestors algorithm to find earlier grafts
When the revisions to graft are numerically close to the destination, this
avoids two walks up the DAG, which for a repository with over 470,000
changesets translates to around 2.2 seconds.
2013-04-06 19:50:03 -07:00
Siddharth Agarwal
d16194fcaf graft: find ancestors of destination lazily
When the revisions to graft are numerically close to the destination, this
avoids one walk up the DAG, which for a repository with over 470,000
changesets translates to around 1.1 seconds.
2013-04-06 20:05:17 -07:00
Bryan O'Sullivan
82ca6ed101 merge with mpm 2013-04-02 08:58:42 -07:00
Siddharth Agarwal
262d694589 pull: list bookmarks before pulling changesets (issue3873)
Consider a bookmark B that exists both locally and remotely. If B is updated
remotely, and then a pull is performed where the pull set contains the new
location of B, the bookmark is updated locally. However, if remote B is
updated in the middle of a pull to a location not in the pull set, the
bookmark won't be updated locally at all.

To fix this, list bookmarks before pulling in changesets, not after. This
still leaves a race open if B gets moved in between listing bookmarks and
pulling in changesets, but the race window is much smaller. Fixing the race
properly would require a bundle format upgrade.

test-hook.t's output changes because we no longer do two listkeys calls during
pull, just one.

test-pull-http.t's output changes because we now search for bookmarks before
searching for changes.
2013-03-29 19:54:06 -07:00
Siddharth Agarwal
266855be39 pull: rename local rb to remotebookmarks
This local will become more important in an upcoming patch, so give it a more
descriptive name.
2013-03-29 19:06:23 -07:00
Simon Heimberg
da12bc2332 serve: pass on the repo instad of recreating it in hgweb
When we pass on the path to the repo, the repo is created in hgweb. But the
repo is already here, so pass it on.
2013-03-21 18:16:49 +01:00
Simon Heimberg
f4736156b4 serve: pass the prepared baseui to hgweb
The baseui was carefully prepared but not used.
ui can contain repo specific settings which can have unwanted effects.
2013-03-21 18:16:48 +01:00
Wagner Bruna
9e929db5bc commands: fix typo in debugobsolete docstring 2013-04-01 18:48:12 -03:00
FUJIWARA Katsunori
53db57bfeb bundle: treat branches created newly on the local correctly (issue3828)
Before this patch, "hg bundle --branch foo other" fails to create
bundle file, if specified "foo" branch is created newly on the local
repository.

"hg bundle" uses "hg.addbranchrevs(repo, other, ...)" to look branch
names up, even though other outgoing-like implementation uses
"hg.addbranchrevs(repo, repo, ...)". In the former invocation, "other"
repository recognizes such branches as unknown, so execution is
aborted.

This patch uses "hg.addbranchrevs(repo, repo, ..)" in "hg bundle" to
bundle revisions on such branches correctly.
2013-02-18 00:04:28 +09:00
Pierre-Yves David
042f644a5b debugobsolete: improve command help
The behavior without argument was not documented.
2013-02-09 23:28:42 +00:00
Kevin Bullock
95941cafe7 bookmarks: show active bookmark even if not at working dir
If the active bookmark doesn't point at a parent of the working dir
(e.g. a pull moved it out from under us), we nonetheless show it as
active. This follows on 13ea5e437ff8 in removing the dichotomy (at least
in the UI) between "current" and "active" bookmarks.
2013-01-27 11:29:14 -06:00
Kevin Bullock
573de12159 help: update verbose 'clone' help to include '@' bookmark 2013-01-25 16:11:16 -06:00
Kevin Bullock
e5bcfe1e27 help: document '@' bookmark in 'help bookmarks' and 'help clone' 2013-01-25 11:06:30 -06:00
Kevin Bullock
dc307a1121 update: update to current bookmark if it moved out from under us (issue3682)
If the current bookmark (the one listed in .hg/bookmarks.current)
doesn't point to a parent of the working directory, e.g. if it was moved
by a pull, use that as the update target instead of the tipmost
descendent.

A small predicate is (finally) added to the bookmarks module to check
whether the current bookmark is also active.
2013-01-21 13:47:10 -06:00
Pierre-Yves David
093fc83eab changectx: fix the handling of tip
We can not use `len(repo,changelog)`, it may be a filtered revision. We now use
`repo,changelog.tip()` to fetch this information.

The `tip` command is also fixed and tested

Thanks goes to Idan Kamara for the initial report.
2013-01-22 11:39:14 +01:00
Wagner Bruna
3b2e42fb86 debugsuccessorssets: fix typos in docstring 2013-01-21 13:47:14 -02:00
Bryan O'Sullivan
9875c114cd debugpathcomplete: satisfy the code checker 2013-03-21 22:29:31 -07:00
Bryan O'Sullivan
25ebd629ba pathcomplete: complete directories more conservatively
Suppose we want to perform a single-level completion (i.e. without
--full) of "fi" in a repo containing "fee", "fie/dead", "fie/live",
and "foe".

If we give back "fie/" as the only answer, the shell will consider
the completion to be unambiguous, and will append a space after the
completion.  We can't complete "fie/live" or "fie/dead" without
first backspacing over that space.

We used to thus create two fake names, "fie/a" and "fie/b", to force
the shell to consider the completion to be ambiguous. It would then
stop at "fie/" without appending a space, allowing us to hit tab
again to complete "fie/live" or "fie/dead".

The change here arises from realising that we only need to force
the shell to consider a completion as ambiguous if we have exactly
one directory and zero files as possible completions.

This prevents spurious names from showing up as possible completions
when they don't need to be invented in the first place.
2013-03-21 22:10:54 -07:00
Bryan O'Sullivan
d521a241b2 completion: add a debugpathcomplete command
The bash_completion code uses "hg status" to generate a list of
possible completions for commands that operate on files in the
working directory. In a large working directory, this can result
in a single tab-completion being very slow (several seconds) as a
result of checking the status of every file, even when there is no
need to check status or no possible matches.

The new debugpathcomplete command gains performance in a few simple
ways:

* Allow completion to operate on just a single directory. When used
  to complete the right commands, this considerably reduces the
  number of completions returned, at no loss in functionality.

* Never check the status of files. For completions that really must
  know if a file is modified, it is faster to use status:

  hg status -nm 'glob:myprefix**'

Performance:

Here are the commands used by bash_completion to complete, run in
the root of the mozilla-central working dir (~77,000 files) and
another repo (~165,000 files):

All "normal state" files (used by e.g. remove, revert):

                            mozilla    other
  status -nmcd 'glob:**'       1.77     4.10 sec
  debugpathcomplete -f -n      0.53     1.26
  debugpathcomplete -n         0.17     0.41

("-f" means "complete full paths", rather than the current directory)

Tracked files matching "a":

                            mozilla    other
  status -nmcd 'glob:a**'      0.26     0.47
  debugpathcomplete -f -n a    0.10     0.24
  debugpathcomplete -n a       0.10     0.22

We should be able to further improve completion performance once
the critbit work lands. Right now, our performance is limited by
the need to iterate over all keys in the dirstate.
2013-03-21 16:31:28 -07:00
Bryan O'Sullivan
59cec2d504 completion: add a debuglabelcomplete command
When completing a "label" (a symbolic name for a commit), the
bash_completion script currently has to invoke hg three times. For
a large repository, the cost of starting up and loading all the
necessary context over and over is very high.

For instance, in mozilla-central:

  time (export HGPLAIN=1; hg tags -q; hg bookmarks -q; hg branches) >/dev/null
  0.446 sec

Compare with the debuglabelcomplete command that this commit adds:

  time hg debuglabelcomplete >/dev/null
  0.148 sec

This greatly helps responsiveness.
2013-03-21 10:51:18 -07:00
Kevin Bullock
0ac9eb1b2b merge 2013-03-18 19:59:05 -05:00
Kevin Bullock
9a9dfa03ff bookmarks: moving the active bookmark deactivates it
After this change, moving the active bookmark somewhere other than the
current changeset (i.e., with --rev) deactivates it. Previously it would
remain in .hg/bookmarks.current, which seems like a bug.
2013-03-16 22:48:22 -05:00
Kevin Bullock
8d31377f62 bookmarks: allow (re-)activating a bookmark on the current changeset
Allow a bookmark that points to the current changeset to be made the
active bookmark without requiring --force. Previously, this would've
aborted with:

  abort: bookmark 'Z' already exists (use -f to force)
2013-03-16 21:36:44 -05:00
Kevin Bullock
f416be4da5 bookmarks: allow moving a bookmark forward to a descendant
Allow 'hg bookmark MARK', with an existing bookmark MARK, to move the
bookmark forward to the current or specified revision, if the target
revision is a descendant of the revision the bookmark currently points
to. Prints a status message including the revision the bookmark was
formerly at:

  $ hg bookmark Z
  moving bookmark 'Z' forward from 663762316562

Test coverage is added.
2013-03-15 23:39:07 -05:00
Augie Fackler
31c30e1b53 Merge 2013-03-17 23:27:14 -05:00
Bryan O'Sullivan
bbd075858d grep: use re2 if possible
Since re2 is enormously faster than Python's re module, this should
help performance, ceteris paribus. grep currently has other huge
performance problems that mask any gain :-(
2013-03-11 12:07:33 -07:00
Dan Villiom Podlaski Christiansen
3950055bca help: move the majority of the help command to the help module
We move the logic for generating the unformatted ReST source to the
help module, in order to eventually avoid calling commands.help_()
from hgweb.

No functionality change.
2013-02-09 21:51:21 +00:00
Bryan O'Sullivan
b87176491b commands: exit from the log loop at the right time
Previously, we'd run the iterator one more time than necessary,
potentially doing a lot of extra work in the process.
2013-02-20 11:31:41 -08:00
Kevin Bullock
d93d5152ce merge with stable 2013-02-19 13:35:39 -06:00
Kevin Bullock
1ada567a36 backout: call cmdutil.commit directly instead of commands.commit
This cleans up the messiness of having one command call another, and
makes the backout command robust against changes to the commit command.
2013-02-12 16:36:44 +00:00
Kevin Bullock
6f2a9a513a commit: factor out status printing into a helper function
We create a new function commitstatus() in cmdutil that handles printing
the status message(s) after a commit. This will allow other commit-like
commands to use it, and in particular is step 2 towards removing
backout's call to commands.commit.
2013-02-12 16:32:14 +00:00
Kevin Bullock
cdcb425321 backout: remove unnecessary dict copy
This is step 1 to remove backout's call to commands.commit. We don't use
the options again anywhere below except for backout's own purposes,
specifically choosing a merge tool, so we just write the commit options
in directly.
2013-02-12 16:05:00 +00:00
Kevin Bullock
86981724b1 backout: remove unnecessary frobbing of addremove option
There's no way for addremove to show up in backout's opts dictionary. It
was being set manually because cmdutil.commit expected it to be there
(and would throw an exception if it wasn't). This was fixed waaaaaaay
back in:

changeset:   5829:e05e83ad9d2b
user:        Kirill Smelkov <kirr@mns.spb.ru>
date:        Thu Jan 10 12:07:18 2008 +0300
summary:     cmdutil.commit: extract 'addremove' from opts carefully
2013-02-12 15:47:30 +00:00
Kevin Bullock
979acf9af6 backout: use cmdutil.revert directly instead of commands.revert
Before this change, backout would explicitly set the options it passed
to commands.revert in order to fall thru most of its logic and call
cmdutil.revert. This change makes it clearer what backup is trying to
accomplish and makes it robust against changes to the revert command.
2013-02-12 15:07:17 +00:00
Thomas Arendsen Hein
dddbcf14eb merge with crew-stable 2013-02-11 16:57:46 +01:00
Kevin Bullock
d86fa541fd import: don't rollback on failed import --exact (issue3616)
The checkexact() helper function was calling repo.rollback() from inside
an open transaction. In addition to being insane, this is unnecessary
because import will release the transaction on an exception.

It turns out that this has been broken since the feature was first
introduced, first released in v1.0:

changeset:   4263:3e8ce73e04cd
user:        Brendan Cully <brendan@kublai.com>
date:        Thu Mar 22 10:44:59 2007 -0700
files:       mercurial/commands.py mercurial/patch.py
description:
Add import --exact.
When this option is set, import will apply the patch (which must
be generated by export) to the parents specified in the patch,
and check that the node produced by the patch matches the node
ID in the patch.
2013-02-10 23:01:12 +00:00
Matt Mackall
2f3cd110be summary: add missing space for updated active bookmark display 2013-02-09 22:54:34 +00:00
Kevin Bullock
fe0a5f965c summary: show active bookmark even if not at current changeset
Before this change, 'hg summary' would not show the active bookmark
unless it pointed to the working directory parent. After this change, it
will show it in parentheses, like so:

parent: 18581:f0ff45fe6700 tip
 summary: simplify handling of active bookmark
branch: default
bookmarks: [crew]
commit: (clean)
update: (current)
2013-02-08 21:47:22 +00:00
Kevin Bullock
9d31a18963 summary: simplify handling of active bookmark 2013-01-27 11:53:46 -06:00
Mads Kiilerich
dd30593de7 refactoring: use unlinkpath with ignoremissing 2013-01-15 23:30:10 +01:00
Mads Kiilerich
fb9e9db8cf identity: report bookmarks sorted 2012-12-12 02:51:02 +01:00
Pierre-Yves David
a1985448ad clfilter: enforce hidden changeset globally
The dispatch code now enables filtering of "hidden" changesets globally. The
filter is installed before command and extension invocation. The `--hidden`
switch is now global and disables this filtering for any command.

Code in log dedicated to changeset exclusion is removed as this global filtering
has the same effect.
2013-01-08 20:37:37 +01:00
Mads Kiilerich
8cb1e5208b debugpushkey: list keys sorted 2012-12-16 20:50:57 +01:00
Mads Kiilerich
d5ef6b65bb debugdiscovery: report heads in sorted order 2012-12-12 02:38:14 +01:00
Pierre-Yves David
8e3d4ef15b phases: prepare phase command for filtering
The phase command have some logic to report change made. We ensure this logic
run unfiltered.

With --force the command can change phase of a changeset for public to draft.
Such change can lead to obsolescence marker to apply again and the changeset to
be "hidden". If we do not run the logic unfiltered it could failed to fetch the
phase of a newly filtered changeset.
2012-12-24 11:58:40 +01:00
Pierre-Yves David
18a17fb6be phases: avoid changectx creation while checking command result
This minor changesets saves the creation of a `changectx` ctx object only used to
fetch the revision number.
2012-12-24 11:57:48 +01:00
Augie Fackler
51e564c918 commands: fix implicit tuple that is invalid syntax in Python3 2013-01-01 13:18:33 -06:00
Pierre-Yves David
bc7f0f7ffa amend: allow amend of non-head when obsolete is enabled
Obsolescence marker can represent this situation just fine. The old
version is marked as precursor of the new changeset. All its
descendants become "unstable".

If obsolescence is not enabled we keep the current behavior of
aborting. This new behavior only applies when obsolete is
enabled and is subject to future discussion and changes.
2012-12-31 17:44:18 -06:00
Mads Kiilerich
275333d6c9 util: fold ENOENT check into unlinkpath, controlled by new ignoremissing flag
Refactor a common pattern.
2012-12-28 11:55:57 +01:00
Kevin Bullock
4ca92b51d3 merge with stable 2012-12-26 11:16:18 -06:00
Mads Kiilerich
a17080a566 bookmarks: fix head selection for merge with two bookmarked heads
A type mismatch caused the search for the other head to fail. The code is
fragile, and instead it ended up using the 'first' bookmark head, but the
ordering is undefined and it could thus randomly use the wrong bookmarkhead
and fail with:

  $ hg up -q -C e@diverged
  $ hg merge
  abort: merging with a working directory ancestor has no effect
2012-12-24 13:26:13 +01:00
Kevin Bullock
2deea1b073 commands: 'hg bookmark NAME' should work even with ui.strict=True
Before this patch, enabling strict command processing (ui.strict=True)
meant that 'hg bookmark NAME', as referenced several places in the
documentation, would not work. This adds 'bookmark' as an explicit alias
to 'bookmarks'.
2012-12-16 22:00:38 -06:00
Tim Henigan
68a1fc4488 update: allow update to existing branches with invalid names (issue3710)
Starting with 049792af94d6, users are no longer able to update a
working copy to a branch named with a "bad" character (such as ':').

Prior to v2.4, it was possible to create branch names using "bad"
characters, so this breaks backwards compatibility.

Mercurial must allow users to update to existing branches with bad
names.  However, it should continue to prevent the creation of new
branches with bad names.

A test was added to confirm that 'hg update' works as expected. The
test uses a bundled repo that was created with an earlier version of
Mercurial.
2012-11-27 08:47:35 -05:00
Pierre-Yves David
292c83cd65 command: remove phase from the list of basic command
This is not a basic command. There is no reason new user should needs to know
about it. Thanks to Matt Mackall for pointing this.
2012-11-28 11:20:56 +01:00
Kevin Bullock
b676337ab7 grep: remove useless while condition
A revised version of 51ea4dcf1448 was sent to the list that fixed this
<http://markmail.org/message/jmfuiise5igcyh2m>, but the older version of
the patch was applied.
2012-11-15 11:27:30 -06:00
Idan Kamara
4ae64fdb03 grep: don't search past the end of the searched string
'*' causes the resulting RE to match 0 or more repetitions of the preceding RE:

>>> bool(re.search('.*', ''))
>>> True

This causes an infinite loop because currently we're only checking if there was
a match without looking at where we are in the searched string.
2012-11-12 19:27:03 +02:00
Pierre-Yves David
da22110fc6 obsolete: compute successors set
Successors set are an important part of obsolescence. It is necessary to detect
and solve divergence situation. This changeset add a core function to compute
them, a debug command to audit them and solid test on the concept.

Check function docstring for details about the concept.
2012-12-13 15:38:43 +01:00
Mads Kiilerich
00be1ef6f3 rm: drop misleading 'use -f' hint for the rm --after 'not removing' warning
A warning mentioning 'forgetting' or 'recording delete' would be more correct
than 'not removing' but also more confusing.
2012-12-09 23:33:16 +01:00
David Schleimer
8fe2e0bb30 graft: explicit current node tracking
This changes graft to explicitly track the progression of commits it
makes, and updates it's idea of the current node based on it's last
commit, rather than from the working copy parent.  This should have no
effect on the value of current since we were reading the working copy
parent immediately after commiting to it.

The motivation for this change is that a subsequent patch will break
the current node and working copy relationship.  Splitting this out
into a separate patch will make that one more readible.
2012-12-04 12:54:18 -08:00
David Schleimer
63ae483369 graft: move commit info building
This moves the logic for generating the commit metadata ahead of the
merge operation.  The only purposae of this patch is to make
subsequent patches easier to read, and there should be no behavior
changes.
2012-12-04 12:54:18 -08:00
FUJIWARA Katsunori
f05ff4243c i18n: add "i18n" comment to column positioning messages of "hg summary"
This comment makes it easier to distinguish such messages from others
for message translators.
2012-10-31 03:59:28 +09:00
Siddharth Agarwal
acc48ffd83 url: use open and not url.open for local files (issue3624) 2012-10-17 21:30:08 -07:00
Tim Henigan
f99bb85c98 branch: add missing repo argument to checknewlabel
scmutil.checknewlabel takes a repo object as its first argument.
When the call to this function was added in 4d438984605c, the
first argument was mistakenly set to 'None'.
2012-11-29 08:49:21 -05:00
Matt Mackall
8b3d6f35a8 merge with stable 2012-11-28 18:08:51 -06:00
Jordi Gutiérrez Hermoso
022cc130e9 bisect: add example for limiting bisection to specified directories
The bisect command does not have an option to limit itself only to
subdirectories, but it's possible to use revsets for the --skip option
for the same effect. Given the relative obscurity of revsets, it helps
to have this as another example for bisect.
2012-11-23 11:59:44 -05:00
Matt Mackall
fd58e8703f i18n: wrap false positives for translation detection 2012-11-25 13:53:47 -06:00
Kevin Bullock
eeb14bc872 merge with crew-stable 2012-11-16 10:20:32 -06:00
Idan Kamara
34cb035697 grep: don't search past the end of the searched string
'*' causes the resulting RE to match 0 or more repetitions of the preceding RE:

>>> bool(re.search('.*', ''))
>>> True

This causes an infinite loop because currently we're only checking if there was
a match without looking at where we are in the searched string.
2012-11-12 19:27:03 +02:00
Augie Fackler
9766845689 bookmarks: introduce a bmstore to manage bookmark persistence
Bookmarks persistence still showed a fair amount of its legacy as a
monkeypatching extension. This encapsulates all bookmarks
serialization and parsing in a single class, and offers a single
location where other bookmarks storage engines can be substituted
in. As a result, many files no longer import the bookmarks module,
which strikes me as an encapsulation win.

This doesn't do anything to the current bookmark state yet, but I'm
hoping put that in the bmstore class as well.
2012-11-07 16:21:39 -06:00
Matt Mackall
59bb4c17e3 tags: add formatter support 2012-11-06 17:38:22 -06:00
Matt Mackall
0776a4dc92 manifest: add formatter support 2012-11-06 17:30:49 -06:00
Matt Mackall
28b6ee7d27 status: use condwrite to avoid zero-width format string hack 2012-11-06 17:30:47 -06:00
Simon Heimberg
13de6e4d2f subrepo: more isolation, only use ui for hg.peer when there is no repo
ui contains repo specific configuration, so do not use it when there is a repo.
But pass it to hg.peer when there is no repo. Then it only contains global
configuration.
2012-10-04 19:46:43 +02:00
Matt Mackall
9bae2c49ee update: check for missing files with --check (issue3595) 2012-10-22 17:23:31 -05:00
Matt Mackall
f5bc386500 remove: don't return error on directories with tracked files
Spotted by Sergey <sergemp@mail.ru>
2012-10-22 16:06:47 -05:00
FUJIWARA Katsunori
477c2590ac help: indicate help omitting if help document is not fully displayed
Before this patch, there is no information about whether help document
is fully displayed or not.

So, some users seem to misunderstand "-v" for "hg help" just as "the
option to show list of global options": experience on "hg help -v" for
some commands not containing verbose containers may strengthen this
misunderstanding.

Such users have less opportunity for noticing omitted help document,
and this may cause insufficient understanding about Mercurial.

This patch indicates help omitting, if help document is not fully
displayed.

For command help, the message below is displayed at the end of help
output, if help document is not fully displayed:

    use "hg -v help xxxx" to show more complete help and the global
    options

and otherwise:

    use "hg -v help xxxx" to show the global options

For topics and extensions help, the message below is displayed, only
if help document is not fully displayed:

    use "hg help -v xxxx" to show more complete help

This allows users to know whether there is any omitted information or
not exactly, and can trigger "hg help -v" invocation.

This patch causes formatting help document twice, to switch messages
one for omitted help, and another for not omitted. This decreases
performance of help document formatting, but it is not mainly focused
at help command invocation, so this wouldn't become problem.
2012-10-18 10:31:15 +09:00
Pierre-Yves David
d1da4847fe debugobsolete: add --flags option
This options allows to specify the `flag` part of obsolete markers. For details
about marker flags, check the `mercurial/obsolete.py` documentation. Some random
flag are added to a marker to test this feature.
2012-10-15 14:45:27 +02:00
Kevin Bullock
7baa4b0e9c bookmarks: further flatten code
This hopefully clarifies the behavior when no NAME is passed, by
separating the branches for listing bookmarks vs. deactivating the
current bookmark.
2012-10-18 16:34:13 -05:00
Kevin Bullock
13bf0fbbec scmutil: add bad character checking to checknewlabel
This factors out the checks from tags and bookmarks, and newly applies
the same prohibitions to branches. checknewlabel takes a new parameter,
kind, indicating the kind of label being checked.

Test coverage is added for all three types of labels.
2012-10-17 21:42:06 -05:00
Kevin Bullock
f8141466d2 bookmarks: use scmutil.checknewlabel
Validation is pulled up into the commands module to avoid an import
cycle.
2012-10-17 17:23:39 -05:00
Kevin Bullock
a3ac9141ee scmutil: add function to validate new branch, tag, and bookmark names
For now the new function only checks to make sure the new label name
isn't a reserved name ('tip', '.', or 'null'). Eventually more of the
checks will be unified between the different types of labels.

The `tag` command is trivially updated to use it. Updating branches and
bookmarks to use it is slightly more invasive and thus reserved for
later patches.
2012-10-17 16:34:46 -05:00
Kevin Bullock
0eae336995 bookmarks: remove redundant check for newline
New bookmarks are already checked for illegal characters (':', '\0',
'\n', and '\r') in bookmarks.valid().
2012-10-17 16:23:42 -05:00
Adrian Buehlmann
7d6b329175 bookmarks: replace code-redundant comment with something more useful 2012-10-18 22:35:28 +02:00
Adrian Buehlmann
8d5e4c41c9 bookmarks: remove another uneeded return 2012-10-18 22:33:58 +02:00
Matt Mackall
0cb0a7ba67 resolve: simplify "finished" message
The recently introduced message was:

  no unresolved files; you may continue your unfinished operation

This had three problems:

- looks a bit like an error message because it's not saying "we've
  just resolved the last file"
- refers to "unfinished operation", which won't be the case with
  "update" or "merge"
- introduces semicolons to error messages, which is stylistically
  questionable

I've simplified this to:

  no more unresolved files

In the future, if we want to prompt someone to continue a particular operation, we should use
a hint style:

  no more unresolved files
  (use 'hg graft --continue' to finish grafting)
2014-05-09 14:46:50 -05:00
Gregory Szorc
85e363fea8 resolve: print message when no unresolved files remain (issue4214)
When using resolve, users often have to consult with the output of |hg
resolve -l| to see if any unresolved files remain. This step is tedious
and adds overhead to resolving.

This patch will notify a user if there are no unresolved files remaining
after executing |hg resolve|::

    no unresolved files; you may continue your unfinished operation

The patch stops short of telling the user exactly what command should be
executed to continue the unfinished operation. That is because this
information is not currently captured anywhere. This would make a
compelling follow-up feature.
2014-04-18 22:19:25 -07:00
Gregory Szorc
3f06fc8ed0 resolve: print warning when no work performed (issue4208)
Previously, if the paths specified as arguments to |hg resolve| were
invalid, they were silently ignored and a no-op would ensue.

This patch fixes that in some scenarios.

If none of the paths specified to |hg resolve| match a path that is in
mergestate, a warning will be emitted.

Ideally, a warning would be emitted for every path/pattern specified
that doesn't match anything. To achieve this would require significant
refactoring of the matching subsystem. That work is beyond the scope of
this patch series. Something is better than nothing and this patch
gets us something.
2014-04-18 18:56:26 -07:00
Gregory Szorc
8e5e922c37 resolve: abort when not applicable (BC)
The resolve command is only relevant when mergestate is present.
This patch will make resolve abort when no mergestate is present.

This change will let people know when they are using resolve when they
shouldn't be. This change will let people know when their use of resolve
doesn't do anything.

Previously, |hg resolve -m| would allow mergestate to be created. This
patch now forbids that. Strictly speaking, this is backwards
incompatible. The author of this patch believes creating mergestate via
resolve doesn't make much sense and this side-effect was unintended.
2014-04-18 19:08:32 -07:00
Gregory Szorc
f5e1a458cd resolve: use early continue and deindent 2014-04-18 18:19:46 -07:00
FUJIWARA Katsunori
ec5abb7d1f localrepo: add "editor" argument to "tag()"
Before this patch, "localrepository.tag()" doesn't take "editor"
argument, and this prevents callers from passing "editor" argument to
"localrepository.commit()" invoked internally.

This patch adds "editor" argument to "localrepository.tag()" (and
"_tag()", too), and makes "commands.tag()" invoke it with "editor"
argument.

This patch also omits explicit "localrepository.savecommitmesssage()"
invocation, because "localrepository.commit()" will invoke specified
"editor" and save edited commit message into ".hg/last-message.txt"
automatically.
2014-05-05 21:26:40 +09:00
Kevin Bullock
c9487f44be update: remove unnecessary argument check 2012-05-05 15:30:54 -05:00
Idan Kamara
1d290d6e7b grep: colorize all fields
Colors were picked in accordance to GNU grep.
2012-10-14 20:27:55 +02:00
Kevin Bullock
6d33154670 bookmarks: simplify code
Remove some unnecessary return statements and collect some checks into
one place. As requested by Thomas Arendsen Hein <thomas@intevation.de>.
2012-10-17 12:15:23 -05:00
David Soria Parra
da3fc820fa bookmarks: abort when incompatible options are used (issue3663)
Options like --delete and --rename are incompatible with each
other. In this case we abort. We do not abort if the result is a nullop.
Nullops are: '--delete --inactive', '--delete --force'.
2012-10-17 11:50:47 +02:00
David Soria Parra
a224be4441 bookmarks: check bookmark format during rename (issue3662) 2012-10-17 08:44:49 +02:00
Sean Farley
a5e6af16d7 color: add additional changeset.phase label to log.changeset and log.parent
This allows the user to set different colors for each phase, e.g.

[color]
changeset.public = blue
changeset.draft = green
changeset.secret = red

In addition, this doesn't affect current configuration for custom log.changeset
colors, but rather adds the option for users that want to visually see which
changesets are amendable.
2012-10-16 13:35:58 -05:00
Siddharth Agarwal
a5e71891bd commands: don't infer repo for commands like update (issue2748)
Maintain a whitelist of commands to infer the repo for instead. The whitelist
contains those commands that take file(s) in the working dir as arguments.
2012-10-16 11:43:15 -07:00
Thomas Arendsen Hein
1c896206b1 merge with crew-stable 2012-10-09 09:45:44 +02:00
Kevin Bullock
564144c8dd bookmarks: deactivate current bookmark if no name is given
a0d2da57b726 added this help text to hg bookmark:

  If no NAME is given, the current active bookmark will be marked inactive.

But that was never actually the case.

Originally spotted by Idan Kamara <idankk86@gmail.com>.
2012-10-08 00:19:30 +02:00
FUJIWARA Katsunori
29424945df help: add information about recovery from corruption to help of "verify"
Before this patch, there is no information about what users should (or
can) do for recovery from corruption of repositories.

This patch adds URL of the Mercurial Wiki page explaining about
recovery from corruption.
2012-10-04 01:24:05 +09:00
David Soria Parra
2a3cae29ea bookmarks: teach the -r option to use revsets 2012-10-01 03:19:23 +02:00
Sergey Kishchenko
bdc9eebe77 resolve: commit the changes after each item resolve (issue3638)
At the moment the resolve command doesn't save progress during the resolve process. In example if you try to resolve 100 conflicting files and interrupt the process (e.g., you close the external merge tool) after resolving 50 files you'll end up with 100 unresolved conflicts. Saving the progress helps a lot with long going merges. It's easy to achieve same behavior with simple script that calls resolve command for each unresolved file but it makes sense to make such behavior a default
2012-09-25 20:50:40 +03:00
Bryan O'Sullivan
dc9ede17dc Merge spelling fixes 2012-09-11 08:36:09 -07:00
timeless@mozdev.org
e67a2d2575 spelling: override 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
023e023a87 en-us: labeled 2012-08-17 13:58:18 -07:00
Adrian Buehlmann
0d13ec9185 manifest: remove redundant sorted() call for --all
repo.store.datafiles() is now already sorted (for all types of stores).

A follow-up to 9dc699058c9e.
2012-08-16 13:57:43 +02:00
Patrick Mezard
04200aa71a debugfileset: implement --rev, more tests 2012-08-15 22:28:32 +02:00
Mads Kiilerich
2372d51b68 fix wording and not-completely-trivial spelling errors and bad docstrings 2012-08-15 22:39:18 +02:00
Mads Kiilerich
2f4504e446 fix trivial spelling errors 2012-08-15 22:38:42 +02:00
Matt Mackall
36c5db3d78 merge with stable 2012-08-24 17:51:47 -05:00
Adrian Buehlmann
5b16379fd5 debuginstall: show directory for Python lib
Example new output

on Windows:

  $ hg debuginstall
  checking encoding (cp1252)...
  checking Python lib (C:\Users\adi\hgrepos\hg-main\hg-python\lib)...
  checking installed modules (C:\Users\adi\hgrepos\hg-main\mercurial)...
  checking templates (C:\Users\adi\hgrepos\hg-main\mercurial\templates)...
  checking commit editor...
  C:\Program Files (x86)\Notepad++\notepad++.exe
  checking username...
  no problems detected

on Linux:

  adi@kork-ubuntu64:~/hgrepos/hg-main$ ./hg debuginstall
  checking encoding (UTF-8)...
  checking Python lib (/usr/lib/python2.7)...
  checking installed modules (/home/adi/hgrepos/hg-main/mercurial)...
  checking templates (/home/adi/hgrepos/hg-main/mercurial/templates)...
  checking commit editor...
  checking username...
  no problems detected
2012-08-06 12:59:47 +02:00
Matt Mackall
04ee099a4c merge with stable 2012-08-24 14:53:07 -05:00
John Li
8400b38f0d merge: handle case when heads are all bookmarks
If all heads are bookmarks, merge fails to find what node to merge
with (throws an IndexError while indexing into the non-bookmark heads
list) as of 208ca72b9343. This catches that case and prints an error
to specify a rev explicitly.
2012-08-22 11:18:35 -04:00
Adrian Buehlmann
9a52491dad update: fix typo in help text
Spotted by Kevin Chase <kevincha99@hotmail.com>
2012-08-06 10:45:11 +02:00
Mads Kiilerich
4d30442bbe help: use the first topic name from helptable, not the longest alias
This makes the 'additional help topics' list consistent with the output from
keyword search (for instance subrepo/subrepos).

The sorting by longest name was introduced in 4cbe49492ad3. There might have
been a good reason for it back then, but now it seems like a better idea to
place the preferred name first in the list in helptable.
2012-08-01 14:59:15 +02:00
Patrick Mezard
33ee7f119d log: make opts entries optional (issue2423) 2012-08-01 15:49:00 +02:00
Mads Kiilerich
688b9e2048 check-code: indent 4 spaces in py files 2012-07-31 03:30:42 +02:00
Patrick Mezard
1701c358d5 debugobsolete: do not traceback on invalid node identifiers 2012-07-30 19:26:05 +02:00
Patrick Mezard
64822182ac addremove: mention --similarity defaults to 100 (issue3430) 2012-07-23 19:03:32 +02:00
Augie Fackler
d7b1ad91f4 strip: move bookmarks to nearest ancestor rather than '.'
If you've got this graph:

0-1-2
   \
    3

and 3 is checked out, 2 is bookmarked with "broken", and you do "hg
strip 2", the bookmark will move to 3, not 1. That's always struck me
as a bug.

This change makes bookmarks move to the tipmost ancestor of
the stripped set rather than the currently-checked-out revision, which
is what I always expected should happen.
2012-07-26 16:57:50 -05:00
Brad Hall
6b8032746f tag: don't allow tagging the null revision (issue1915)
Also fixed the tests that were doing this and expected it to work
2012-06-05 17:00:13 -07:00
Patrick Mezard
2e04c51661 identity: show trailing '+' for dirty subrepos (issue2839) 2012-07-27 13:56:19 +02:00
Patrick Mezard
7221d12e58 discovery: add extinct changesets to outgoing.excluded
Before this change, push would incorrectly fast-path the bundle
generation when extinct changesets are involved, because they are not
added to outgoing.excluded. The reason to do so are related to
outgoing.excluded being assumed to contain only secret changesets by
scmutil.nochangesfound(), when displaying warnings like:

 changes found (ignored 9 secret changesets)

Still, outgoing.excluded seems like a good API to report the extinct
changesets instead of dedicated code and nothing in the docstring
indicates it to be bound to secret changesets. This patch adds extinct
changesets to outgoing.excluded and fixes scmutil.nochangesfound() to
filter the excluded node list.

Original version and test by Pierre-Yves.David@ens-lyon.org
2012-07-25 19:34:31 +02:00
Adrian Buehlmann
18bc26986d update: put rules for uncommitted changes into verbose help section 2012-07-14 18:29:46 +02:00
Peter Arrenbrecht
ef7b77046e peer: introduce real peer classes
This change separates peer implementations from the repository implementation.
localpeer currently is a simple pass-through to localrepository, except for
legacy calls, which have already been removed from localpeer. This ensures that
the local client code only uses the most modern peer API when talking to local
repos.

Peers have a .local() method which returns either None or the underlying
localrepository (or descendant thereof). Repos have a .peer() method to return
a freshly constructed localpeer. The latter is used by hg.peer(), and also to
allow folks to pass either a peer or a repo to some generic helper methods.
We might want to get rid of .peer() eventually.

The only user of locallegacypeer is debugdiscovery, which uses it to pose as a
pre-setdiscovery client. But we decided to leave the old API defined in
locallegacypeer for clarity and maybe for other uses in the future.

It might be nice to actually define the peer API directly in peer.py as stub
methods. One problem there is, however, that localpeer implements
lock/addchangegroup, whereas the true remote peers implement unbundle.
It might be desireable to get rid of this distinction eventually.
2012-07-13 21:47:06 +02:00
Sune Foldager
ffe56435bf peer: introduce peer methods to prepare for peer classes
This introduces a peer method into all repository classes, which currently
simply returns self. It also changes hg.repository so it now raises an
exception if the supplied paths does not resolve to a localrepo or descendant.

Finally, all call sites are changed to use the peer and local methods as
appropriate, where peer is used whenever the code is dealing with a remote
repository (even if it's on local disk).
2012-07-13 21:46:53 +02:00
Augie Fackler
62bcb3f2f9 bookmarks: document behavior of -B/--bookmark in help 2012-07-06 14:12:42 -05:00
Patrick Mezard
c99c100ff8 debugrevlog: handle numrevs == numfull case (issue3537)
Instead of tracing back with a ZeroDivisionError.
2012-07-11 11:52:42 +02:00
Patrick Mezard
1bc1374fa9 incoming/outgoing: handle --graph in core 2012-07-11 18:22:07 +02:00
Patrick Mezard
ea80881882 log: support --graph without graphlog extension
The glog command is preserved in the extension for backward compatibility.
2012-07-14 19:09:22 +02:00
Pierre-Yves David
8a22ab8e06 push: accept revset argument for --rev 2012-07-05 19:53:04 +02:00
Martin Geisler
75be7b05da merge with crew-stable 2012-07-12 13:33:53 +02:00
Adrian Buehlmann
18cf0b55ff revert: use term "uncommitted merge" in help text
to make sure users can't possibly be mislead to try this for canceling a
*merge changeset*.
2012-07-09 17:51:46 +02:00
Adrian Buehlmann
f4bd1660eb update: mention how update can be used to cancel an uncommitted merge 2012-07-10 21:26:18 +02:00
Adrian Buehlmann
bd2cde6763 update: move help text about parent revision higher up
emphasizing how important the parent revision is
2012-07-10 11:15:22 +02:00
Adrian Buehlmann
69f9a7e33f rollback: move examples and --force note in help into verbose section
Plain 'hg help rollback' now looks like this:

  $ hg help rollback
  hg rollback

  roll back the last transaction (dangerous)

      This command should be used with care. There is only one level of
      rollback, and there is no way to undo a rollback. It will also restore
      the dirstate at the time of the last transaction, losing any dirstate
      changes since that time. This command does not alter the working
      directory.

      Transactions are used to encapsulate the effects of all commands that
      create new changesets or propagate existing changesets into a repository.

      This command is not intended for use on public repositories. Once changes
      are visible for pull by other users, rolling a transaction back locally
      is ineffective (someone else may already have pulled the changes).
      Furthermore, a race is possible with readers of the repository; for
      example an in-progress pull from the repository may fail if a rollback is
      performed.

      Returns 0 on success, 1 if no rollback data is available.

  options:

   -n --dry-run do not perform actions, just print output
   -f --force   ignore safety measures
      --mq      operate on patch repository

  use "hg -v help rollback" to show more info
2012-07-11 09:12:31 +02:00
Adrian Buehlmann
427ff24c6f rollback: split off command example paragraph in help 2012-07-11 09:08:26 +02:00
Martin Geisler
0a036ffb67 merge with crew-stable 2012-07-12 10:41:56 +02:00
Pierre-Yves David
100b68ca2e obsolete: write obsolete marker inside a transaction
Marker are now written as soon as possible but within a transaction. Using a
transaction ensure a proper behavior on error and rollback compatibility.

Flush logic are not necessary anymore and are dropped from lock release.

With this changeset, the obsstore is open, written and closed for every single
added marker. This is expected to be highly inefficient and batched write should
be implemented "quickly".

Another issue is that every flush of the file will invalidate the obsstore
filecache and trigger a full re instantiation of the repo.obsstore attribute
(including, reading and parsing entry). This is also expected to be highly
inefficient and proper filecache operation should be implemented "quickly" too.

A side benefit of the filecache issue is that repo.obsstore  object is properly
invalidated on transaction abortion.
2012-07-04 02:21:04 +02:00
Matt Mackall
b02cfbb12b debugobsolete: remove spurious ctx from variable name
'contexts' are objects like the ones described in context.py, not
anything that describes a situation.
2012-07-11 18:35:14 -05:00
Yuya Nishihara
7714ac81fa graft: don't drop the second parent on unsuccessful merge (issue3498)
This replicates the strategy of rebase, which postpones setparents and
duplicatecopies after checking the merge stats.

Without the second parent, resolve cannot redo merge.
2012-06-16 17:05:55 +09:00
Pierre-Yves.David@ens-lyon.org
715c9d5f3e debugobsolete: list all obsolete marker if no argument are specified 2012-06-07 19:20:44 +02:00
Pierre-Yves.David@ens-lyon.org
0d5addf62d command: creation of obsolete marker
* add metadata encoding/decoding ability

* add a method to obsstore to help creating marker

* add a debug command to create marker
2012-06-07 19:15:23 +02:00
Matt Mackall
61aa1f42b8 merge with stable 2012-06-29 00:40:52 -05:00
Kevin Bullock
926372b575 update: fix help regarding update to ancestor
As pointed out on the user mailing list, hg will update just as happily
to an ancestor if there are uncommitted changes as to a descendant.
2012-06-05 13:33:52 -05:00
Matt Mackall
49a9d0006f help: drop -a from heads syntax summary (issue3483) 2012-06-04 17:22:09 -05:00
Idan Kamara
897b2d782b graft: restore config option on correct ui 2012-06-04 15:43:16 +03:00
Thomas Arendsen Hein
ad3dbec4ae graft: allow -r to specify revisions 2012-06-20 17:02:43 +02:00
Thomas Arendsen Hein
0e93bb1709 consistency: use REV instead of REVISION 2012-06-20 16:49:04 +02:00
Thomas Arendsen Hein
64a2699762 export: add optional -r to synopsis
It is not already covered by [OPTION]..., because in this case REV... would
need to be marked optional.
2012-06-20 16:46:10 +02:00
Adrian Buehlmann
53aa68cb2c debugwalk: observe ui.slash config option 2012-06-11 11:15:14 +02:00
Mads Kiilerich
8a58b3e3c1 help: sort results from keyword search 2012-06-13 02:44:46 +02:00
Martin Geisler
1b024d518a bisect: lowercase status message 2012-06-12 14:18:18 +02:00
Martin Geisler
a06bcd028f serve: lowercase "no repo here" message 2012-06-12 14:18:18 +02:00
Martin Geisler
7b0a61680f debuginstall: lowercase status messages 2012-06-12 14:18:18 +02:00
Matt Mackall
cb4824284b merge with stable 2012-06-06 21:17:33 -05:00
Matt Mackall
b536e9c850 merge with stable 2012-06-04 17:57:57 -05:00
Olav Reinert
514c0b4725 help: fix keyword search result formatting
This patch fixes the broken formatting of keyword search results. Some blank
lines were missing from the RST markup, which caused markup to be printed.
2012-06-05 00:32:18 +02:00
Bryan O'Sullivan
6ba97b40c1 revlog: ancestors(*revs) becomes ancestors(revs) (API)
Accepting a variable number of arguments as the old API did is
deeply ugly, particularly as it means the API can't be extended
with new arguments.  Partly as a result, we have at least three
different implementations of the same ancestors algorithm (!?).

Most callers were forced to call ancestors(*somelist), adding to
both inefficiency and ugliness.
2012-06-01 12:37:18 -07:00
Matt Mackall
ea8120ba7b merge with stable 2012-06-04 16:59:57 -05:00
Olav Reinert
c77c77574f help: format all output using RST
This change is the last patch needed to implement help text generation based
only on formatting a single text object marked up with RST.
2012-06-02 11:28:43 +02:00
Olav Reinert
54cafa029d help: format command and option list help using RST
This patch changes the function which generates help text about commands and
options to use RST formatting. Tables describing options have been formatted
using RST table markup for some time already, so their appearance does not
change. Command lists, however, change appearance.

To format non-verbose command lists, RST field list markup was chosen, because
it resembles the old format:

<http://docutils.sourceforge.net/docs/user/rst/quickref.html#field-lists>

In the old (hand-coded) format of non-verbose command lists, the left column is
12 characters wide. Our minirst implementation formats field lists with a left
column 14 characters wide, so this patch changes the appearance of help output
correspondingly:

<http://markmail.org/message/krl4cxopsnii7s6z?q=mercurial+reinert+from:%22Olav+Reinert%22&page=2>

The minirst markup most closely resembling the old verbose command lists is
definition lists. But using it would cause a blank line to be inserted between
each command definition, making the output excessively long, and no more
useful than before. To avoid this, I chose to use field lists also for verbose
command help, resulting in output like this example:

 add           add the specified files on the next commit
 annotate, blame
               show changeset information by line for each file
 clone         make a copy of an existing repository
 commit, ci    commit the specified files or all outstanding changes
 diff          diff repository (or selected files)
 export        dump the header and diffs for one or more changesets
 forget        forget the specified files on the next commit
 init          create a new repository in the given directory
 log, history  show revision history of entire repository or files
 merge         merge working directory with another revision
 phase         set or show the current phase name
 pull          pull changes from the specified source
 push          push changes to the specified destination
 qdiff         diff of the current patch and subsequent modifications
 qinit         init a new queue repository (DEPRECATED)
 qnew          create a new patch
 qpop          pop the current patch off the stack
 qpush         push the next patch onto the stack
 qrefresh      update the current patch
 remove, rm    remove the specified files on the next commit
 serve         start stand-alone webserver
 status, st    show changed files in the working directory
 summary, sum  summarize working directory state
 update, up, checkout, co
               update working directory (or switch revisions)

This change is a move towards generating all help text as a list of strings
marked up with RST.
2012-06-02 11:25:40 +02:00
Olav Reinert
8cf6a50897 help: format extension lists using RST
This change is a move towards generating all help text as a list of strings
marked up with RST.
2012-06-02 11:22:33 +02:00
Olav Reinert
df3544e597 help: format command help using RST 2012-06-01 12:35:30 +02:00
Olav Reinert
6303dbc23d help: format topic help using RST 2012-06-01 12:15:45 +02:00
Olav Reinert
243a5a590a help: inline helper function used once only 2012-06-01 12:01:33 +02:00
Olav Reinert
70c42374e2 minirst: generate tables as a list of joined lines 2012-06-01 11:58:23 +02:00
Olav Reinert
39ea6b3464 help: inline helper function used once only 2012-05-22 22:08:41 +02:00
Olav Reinert
a1155c64ad help: remove redundant parameter 2012-05-22 22:08:41 +02:00
Olav Reinert
b372d3da28 help: move some helper functions to help.py 2012-05-22 22:08:41 +02:00
Olav Reinert
2dabd3c23f help: remove dependency on ui from some helper functions 2012-05-22 22:08:41 +02:00
Sune Foldager
aea3159eaa bundle: make bundles more portable (isue3441)
This is achieved by acting as if the user had given -r<rev> for each head rev
of outgoing changesets on the command line, as well as appropriate
--base <rev>.

The discovery information is computed as normal, and then adjusted as above.
2012-05-12 19:38:20 +02:00
Matt Mackall
67c0680caa merge with stable 2012-05-17 15:52:14 -05:00
Brodie Rao
74e79a93a2 branches: improve performance by removing redundant operations
This refactors the branches command so it collects all the information it needs
about a branch in one pass over the branch map.

In particular, it fixes an issue where the command called repo.branchtags() to
get branch tips, and then used repo.branchheads() to get the closed/open
status. Both repo methods read the changelog to determine if the branch is
closed, resulting in extra, redundant I/O.

For the PyPy repo with 744 branches and 843 branch heads, this brings
hg branches over NFS from:

   CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
        2427            0      0.9057      0.9057   <open>
        2424            0      0.4096      0.4096   <method 'close' of 'file' objects>
        2424            0      0.0476      0.0476   <method 'read' of 'file' objects>
           1            0      0.0468      0.0468   mercurial.revlog:637(headrevs)
          +1            0      0.0000      0.0000   +<len>
        2422            0      0.0443      0.0443   <method 'seek' of 'file' objects>
        2962            0      0.0337      0.0337   <zlib.decompress>
        2491            0      1.8008      0.0322   mercurial.changelog:182(read)
       +2491            0      1.6982      0.0315   +mercurial.revlog:881(revision)
       +2488            0      0.0269      0.0134   +mercurial.changelog:28(decodeextra)
       +4982            0      0.0085      0.0085   +<method 'split' of 'str' objects>
       +4982            0      0.0274      0.0049   +mercurial.encoding:61(tolocal)
       +2491            0      0.0039      0.0039   +<method 'index' of 'str' objects>
        2491            0      1.6982      0.0315   mercurial.revlog:881(revision)
       +2413            0      0.0112      0.0112   +mercurial.revlog:305(rev)
       +2491            0      1.5315      0.0068   +mercurial.revlog:847(_chunkraw)
       +2491            0      0.0414      0.0058   +mercurial.revlog:945(_checkhash)
       +2491            0      0.0028      0.0028   +mercurial.revlog:349(flags)
       +2491            0      0.0025      0.0025   +<mercurial.mpatch.patches>
        2422            0      1.5089      0.0286   mercurial.revlog:818(_loadchunk)
       +2422            0      0.4093      0.4093   +<method 'close' of 'file' objects>
       +2422            0      0.0451      0.0451   +<method 'read' of 'file' objects>
       +2422            0      0.0443      0.0443   +<method 'seek' of 'file' objects>
       +2422            0      0.9703      0.0096   +mercurial.store:374(__call__)
       +2422            0      0.0079      0.0069   +mercurial.revlog:810(_addchunk)
        5804            0      0.0204      0.0204   mercurial.revlog:305(rev)
        2426            0      0.9552      0.0177   mercurial.scmutil:218(__call__)
       +2426            0      0.9057      0.9057   +<open>
       +2426            0      0.0120      0.0083   +os.path:80(split)
       +2426            0      0.0061      0.0049   +mercurial.scmutil:92(__call__)
Time: real 1.950 secs (user 0.560+0.000 sys 0.220+0.000)

down to:

   CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
        1545            0      0.6035      0.6035   <open>
        1542            0      0.2697      0.2697   <method 'close' of 'file' objects>
           1            0      0.0547      0.0547   mercurial.revlog:637(headrevs)
          +1            0      0.0000      0.0000   +<len>
        1542            0      0.0389      0.0389   <method 'read' of 'file' objects>
        1540            0      0.0316      0.0316   <method 'seek' of 'file' objects>
        1853            0      0.0227      0.0227   <zlib.decompress>
        1557            0      1.2131      0.0226   mercurial.changelog:182(read)
       +1557            0      1.1398      0.0221   +mercurial.revlog:881(revision)
       +1555            0      0.0199      0.0094   +mercurial.changelog:28(decodeextra)
       +3114            0      0.0058      0.0058   +<method 'split' of 'str' objects>
       +3114            0      0.0196      0.0035   +mercurial.encoding:61(tolocal)
       +1557            0      0.0026      0.0026   +<method 'index' of 'str' objects>
        1557            0      1.1398      0.0221   mercurial.revlog:881(revision)
       +1557            0      1.0307      0.0047   +mercurial.revlog:847(_chunkraw)
       +1557            0      0.0287      0.0040   +mercurial.revlog:945(_checkhash)
       +1557            0      0.0018      0.0018   +<mercurial.mpatch.patches>
       +1557            0      0.0018      0.0018   +mercurial.revlog:326(node)
       +1557            0      0.0417      0.0013   +mercurial.revlog:857(_chunkbase)
        1540            0      1.0147      0.0210   mercurial.revlog:818(_loadchunk)
       +1540            0      0.2693      0.2693   +<method 'close' of 'file' objects>
       +1540            0      0.0360      0.0360   +<method 'read' of 'file' objects>
       +1540            0      0.0316      0.0316   +<method 'seek' of 'file' objects>
       +1540            0      0.6487      0.0070   +mercurial.store:374(__call__)
       +1540            0      0.0059      0.0052   +mercurial.revlog:810(_addchunk)
        3192            0      0.0173      0.0173   mercurial.revlog:305(rev)
        8184            0      0.0300      0.0147   <method 'decode' of 'str' objects>
       +5204            0      0.0149      0.0048   +encodings.utf_8:15(decode)
          +1            0      0.0004      0.0000   +encodings:71(search_function)
          43           26      0.0147      0.0129   <__import__>
Time: real 1.390 secs (user 0.450+0.000 sys 0.170+0.000)
2012-05-13 14:04:07 +02:00
Brodie Rao
ab32f1721d context: add changectx.closesbranch() method
This removes the duplicated code for inspecting the 'close' extra field in
a changeset.
2012-05-13 14:04:06 +02:00
Brodie Rao
d36ae7f264 localrepo: add branchtip() method for faster single-branch lookups
For the PyPy repo with 744 branches and 843 branch heads, this brings
hg log -r default over NFS from:

   CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
        3249            0      1.3222      1.3222   <open>
        3244            0      0.6211      0.6211   <method 'close' of 'file' objects>
        3243            0      0.0800      0.0800   <method 'read' of 'file' objects>
        3241            0      0.0660      0.0660   <method 'seek' of 'file' objects>
        3905            0      0.0476      0.0476   <zlib.decompress>
        3281            0      2.6756      0.0472   mercurial.changelog:182(read)
       +3281            0      2.5256      0.0453   +mercurial.revlog:881(revision)
       +3276            0      0.0389      0.0196   +mercurial.changelog:28(decodeextra)
       +6562            0      0.0123      0.0123   +<method 'split' of 'str' objects>
       +6562            0      0.0408      0.0073   +mercurial.encoding:61(tolocal)
       +3281            0      0.0054      0.0054   +<method 'index' of 'str' objects>
        3241            0      2.2464      0.0456   mercurial.revlog:818(_loadchunk)
       +3241            0      0.6205      0.6205   +<method 'close' of 'file' objects>
       +3241            0      0.0765      0.0765   +<method 'read' of 'file' objects>
       +3241            0      0.0660      0.0660   +<method 'seek' of 'file' objects>
       +3241            0      1.4209      0.0135   +mercurial.store:374(__call__)
       +3241            0      0.0122      0.0107   +mercurial.revlog:810(_addchunk)
        3281            0      2.5256      0.0453   mercurial.revlog:881(revision)
       +3280            0      0.0175      0.0175   +mercurial.revlog:305(rev)
       +3281            0      2.2819      0.0119   +mercurial.revlog:847(_chunkraw)
       +3281            0      0.0603      0.0083   +mercurial.revlog:945(_checkhash)
       +3281            0      0.0051      0.0051   +mercurial.revlog:349(flags)
       +3281            0      0.0040      0.0040   +<mercurial.mpatch.patches>
       13682            0      0.0479      0.0248   <method 'decode' of 'str' objects>
       +7418            0      0.0228      0.0076   +encodings.utf_8:15(decode)
          +1            0      0.0003      0.0000   +encodings:71(search_function)
        3248            0      1.3995      0.0246   mercurial.scmutil:218(__call__)
       +3248            0      1.3222      1.3222   +<open>
       +3248            0      0.0235      0.0184   +os.path:80(split)
       +3248            0      0.0084      0.0068   +mercurial.scmutil:92(__call__)
Time: real 2.750 secs (user 0.680+0.000 sys 0.360+0.000)

down to:

   CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
          55           31      0.0197      0.0163   <__import__>
          +1            0      0.0006      0.0002   +mercurial.context:8(<module>)
          +1            0      0.0042      0.0001   +mercurial.revlog:12(<module>)
          +1            0      0.0002      0.0001   +mercurial.match:8(<module>)
          +1            0      0.0003      0.0001   +mercurial.dirstate:7(<module>)
          +1            0      0.0057      0.0001   +mercurial.changelog:8(<module>)
           1            0      0.0117      0.0032   mercurial.localrepo:525(_readbranchcache)
        +844            0      0.0015      0.0015   +<binascii.unhexlify>
        +845            0      0.0010      0.0010   +<method 'split' of 'str' objects>
        +843            0      0.0045      0.0009   +mercurial.encoding:61(tolocal)
        +843            0      0.0004      0.0004   +<method 'setdefault' of 'dict' objects>
          +1            0      0.0003      0.0003   +<method 'close' of 'file' objects>
           3            0      0.0029      0.0029   <method 'read' of 'file' objects>
           9            0      0.0018      0.0018   <open>
         990            0      0.0017      0.0017   <binascii.unhexlify>
          53            0      0.0016      0.0016   mercurial.demandimport:43(__init__)
         862            0      0.0015      0.0015   <_codecs.utf_8_decode>
         862            0      0.0037      0.0014   <method 'decode' of 'str' objects>
        +862            0      0.0023      0.0008   +encodings.utf_8:15(decode)
         981            0      0.0011      0.0011   <method 'split' of 'str' objects>
         861            0      0.0046      0.0009   mercurial.encoding:61(tolocal)
        +861            0      0.0037      0.0014   +<method 'decode' of 'str' objects>
         862            0      0.0023      0.0008   encodings.utf_8:15(decode)
        +862            0      0.0015      0.0015   +<_codecs.utf_8_decode>
           4            0      0.0008      0.0008   <method 'close' of 'file' objects>
         179          154      0.0202      0.0004   mercurial.demandimport:83(__getattribute__)
         +36           11      0.0199      0.0003   +mercurial.demandimport:55(_load)
         +72            0      0.0001      0.0001   +mercurial.demandimport:83(__getattribute__)
         +36            0      0.0000      0.0000   +<getattr>
           1            0      0.0015      0.0004   mercurial.tags:148(_readtagcache)
Time: real 0.060 secs (user 0.030+0.000 sys 0.010+0.000)
2012-05-13 14:04:04 +02:00
Patrick Mezard
abc8f672ec phase: remove useless test, olddata is never None 2012-05-12 16:53:36 +02:00
Matt Mackall
c1a3a77a6b help: tweak keyword format output 2012-05-13 15:26:06 +02:00
Augie Fackler
c94e6f7b05 help: add --keyword (-k) for searching help 2012-05-13 06:03:11 -05:00
David Soria Parra
7d0d5a5a60 merge: respect bookmarks during merge
Bookmarks will behave more like named branches when merge tries to pick
a revision to merge.

Bookmarks now to respect the current bookmarks.  Bookmarks will not
accidentally merged with unnamed heads or other bookmarks. However merge
can pick heads with diverging bookmarks and pick those automatically.

We end up with two cases for picking a revision to merge:
 (1) In case of an current bookmark, merge can pick a branch head that has a
     diverged bookmark
 (2) In case of no current bookmark, merge can pick a branch head that does not
     have a bookmark.
2012-05-13 11:55:42 +02:00
Brodie Rao
7f47d4e347 check-code: ignore naked excepts with a "re-raise" comment
This also promotes the naked except check from a warning to an error.
2012-05-13 13:18:06 +02:00
Mads Kiilerich
803e845d28 unbundle: move bookmark update outside the lock
abf413aa5fdc introduced updatecurrentbookmark after unbundle, but that path
might end up taking a wlock after lock when writing the bookmarks.
2012-05-12 20:06:04 +02:00
Brodie Rao
a706d64a2c cleanup: replace naked excepts with except Exception: ... 2012-05-12 16:02:46 +02:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
Levi Bard
4d4fd8dd61 graft: implement --log (issue3438) 2012-05-11 18:51:35 +02:00
Patrick Mezard
aa6e824ce1 phase: make if abort on nullid for the good reason
The good reason being you cannot call retractboundary() on nullid, not
revset.set() cannot resolve '-1'.
2012-05-12 00:24:07 +02:00
Patrick Mezard
641ee7d3ba phases: introduce phasecache
The original motivation was changectx.phase() had special logic to
correctly lookup in repo._phaserev, including invalidating it when
necessary. And at other places, repo._phaserev was accessed directly.

This led to the discovery that phases state including _phaseroots,
_phaserev and _dirtyphase was manipulated in localrepository.py,
phases.py, repair.py, etc. phasecache helps encapsulating that.

This patch replaces all phase state in localrepo with phasecache and
adjust related code except for advance/retractboundary() in phases.
These still access to phasecache internals directly. This will be
addressed in a followup.
2012-05-12 00:24:07 +02:00
Bryan O'Sullivan
2493c7a8d1 bisect: set HG_NODE when runing a command
When running a command, set the environment variable HG_NODE to
tell the command which changeset is being visited.
2012-05-08 15:31:00 -07:00
Bryan O'Sullivan
01cb9841ca bisect: track the current changeset (issue3382)
Introduce a new revset feature, bisect(current), that identifies
the changeset currently being bisected.
2012-05-08 15:29:09 -07:00
Matt Mackall
48471fd098 merge with stable 2012-05-12 00:06:11 +02:00
Levi Bard
56db29ce72 addremove: document default similarity behavior (issue3429) 2012-05-11 15:15:50 +02:00
Travis Herrick
c8cb411c3a branches: quiet option observes other parameters 2012-05-06 17:12:22 -07:00
Matt Mackall
d7cd292c1a merge with stable 2012-05-08 12:05:45 -05:00
Matt Mackall
a7305a2b09 graft: remark on empty graft 2012-05-06 14:15:17 -05:00
Yuya Nishihara
8284425c7d commands: parse ui.strict config item as bool 2012-05-06 23:58:04 +09:00
Bryan O'Sullivan
130a47d385 bisect: save current state before running a command
This prevents an external command being run during a bisect from
querying stale data.
2012-05-02 17:15:11 -07:00
A. S. Budden
95a9277375 help: add reference to template help (issue3413)
There is currently no clear link between the help for log
and the help on templates.  The log option is --template
but the template help is 'help templating' or 'help templates'.
This patch makes 'hg help template' work and also adds a
note into the log help explaining where to find more info.
2012-05-01 22:14:51 +01:00
Patrick Mezard
2c65c226cf localrepo: add setparents() to adjust dirstate copies (issue3407)
The fix introduced in 3509b9cf8f86 was only partially successful. It is correct
to turn dirstate 'm' merge records into normal/dirty ones but copy records are
lost in the process. To adjust them as well, we need to look in the first
parent manifest to know which files were added and preserve only related
records. But the dirstate does not have access to changesets, the logic has to
moved at another level, in localrepo.
2012-04-29 22:25:55 +02:00
Adrian Buehlmann
66bff3361f commit: use ui.configbool when checking 'commitsubrepos' setting on --amend
Before this fix, having

   [ui]
   commitsubrepos = False

in the config file lead to

   $ hg ci --amend -mx
   abort: cannot amend recursively
2012-04-21 10:23:47 +02:00
Patrick Mezard
036643538d update: make --check abort with dirty subrepos
Aka "we could use dirty() but... yeah let's use it"
2012-04-23 12:12:04 +02:00
Patrick Mezard
fe825199c5 update: fix "not rev" vs "rev is None" 2012-04-23 12:09:54 +02:00
Idan Kamara
a5b84a16ff commands: add missing wlock to graft 2012-04-19 18:11:48 +03:00
Idan Kamara
5db73f60d8 commands: add missing wlock to branch 2012-04-19 17:59:23 +03:00
Idan Kamara
09faf4a623 commands: add missing wlock to backout 2012-04-19 17:59:23 +03:00
Idan Kamara
66000da94d commit: add option to amend the working dir parent
The --amend flag can be used to amend the parent of the working directory
with a new commit that contains the changes in the parent in addition to
those currently reported by "hg status", if there are any. The old commit
is stored in a backup bundle in ".hg/strip-backup"(see "hg help bundle"
and "hg help unbundle" on how to restore it).

Message, user and date are taken from the amended commit unless specified.
When a message isn't specified on the command line, the editor will open
with the message of the amended commit.

It is not possible to amend public changesets (see "hg help phases") or
changesets that have children.

Behind the scenes, first commit the update (if there is one) as a regular
child of the current parent. Then create a new commit on the parent's
parent with the updated contents. Then change the working copy parent
to this new combined changeset. Finally, strip the amended commit and
update commit created in the beginning.

An alternative (cleaner?) approach of doing this is suggested here:
http://selenic.com/pipermail/mercurial-devel/2012-March/038540.html

It is currently not possible to amend merge commits or recursively,
this can be added at a later time.
2012-04-18 01:20:16 +03:00
Bryan O'Sullivan
9b32b66805 commands: move bundle type validation earlier
Checking the bundle type late in the command's execution can mean
that we do work for a long time before complaining about incorrect
user input and aborting.  Guess how I discovered this.
2012-04-13 11:01:07 -07:00