Commit Graph

2595 Commits

Author SHA1 Message Date
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
Matt Mackall
424daf7479 graft: add --dry-run support (issue3362) 2012-04-10 12:49:12 -05:00
Matt Mackall
560dd93d34 merge with stable 2012-04-06 15:18:14 -05:00
Thomas Arendsen Hein
7c3a892f08 export: catch exporting empty revsets (issue3353)
Additionally add tests for empty revsets and unknown revisions.
2012-04-04 12:31:31 +02:00
Angel Ezquerra
a67f0ff376 revert: move bulk of revert command from commands to cmdutil
This revision has no functionality change. The code on the original
commands.revert() function has been split. The first part of the
original code, which checks that the command inputs are correct
remains in commands.revert(). The rest of the function, which performs
the actual revert operation has been moved into cmdutil.revert().

The purpose of this change is to make it easier to perform a revert
operation, from other parts of the code. This may be used to implement
reverting of subrepos.
2012-03-28 11:42:17 +02:00
Matt Mackall
369755dc10 encoding: tune fast-path of tolocal a bit 2012-03-22 16:54:46 -05:00
Matt Mackall
cc8b3a2b01 pvec: introduce pvecs 2012-03-12 13:37:39 -05:00
Matt Mackall
7f2d6a6af7 merge with stable 2012-03-08 15:59:33 -06:00
Matt Mackall
f2a652218a i18n: fix all remaining uses of % inside _() 2012-03-08 13:35:27 -06:00
Javi Merino
826c30884c update: don't translate the abort message twice
The string representation of util.Abort() is translated when
merge.update() raises the exception.  For languages with characters
out of the valid ascii range, if we feed them again to i18n.gettext()
mercurial dies with:

[...]
  File "/home/javi/src/mercurial/mercurial/hg-mpm/mercurial/commands.py", line 4287, in postincoming
    ui.warn(_("not updating: %s\n" % str(inst)))
  File "/home/javi/src/mercurial/mercurial/hg-mpm/mercurial/i18n.py", line 42, in gettext
    u = u'\n\n'.join([p and t.ugettext(p) or '' for p in paragraphs])
  File "/usr/lib/python2.7/gettext.py", line 404, in ugettext
    return unicode(message)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 14: ordinal not in range(128)

To reproduce this error, just try to pull a changeset that crosses
branches with LANG=ru_RU.UTF-8
2012-03-07 23:21:11 +00:00
Matt Mackall
4a144a5db5 merge with stable 2012-03-04 16:48:04 -06:00
Wagner Bruna
0c54f0439f debugbuilddag: fix starting a dag on a non-default branch 2012-03-02 11:46:18 -03:00
Idan Kamara
263be8e6a2 update: delete bookmarks.current when explicitly updating to a rev (issue3276) 2012-02-28 23:47:46 +02:00
Idan Kamara
0aba016d12 update: don't move the active bookmark if a rev is specified with -r 2012-02-28 01:07:55 +02:00
Patrick Mezard
e329a7b4ce debugrevspec: pretty print output
Before:

  ('func', ('symbol', 'reverse'), ('func', ('symbol', 'sort'), ('list', ('or',
  ('symbol', '2'), ('symbol', '3')), ('symbol', 'date'))))

After:

  (func
    ('symbol', 'reverse')
    (func
      ('symbol', 'sort')
      (list
        (or
          ('symbol', '2')
          ('symbol', '3'))
        ('symbol', 'date'))))

v2:
- Rebased on stable to avoid having to merge tests output
2012-02-24 11:02:21 +01:00
Matt Mackall
38ab0032cb merge with stable 2012-02-28 21:17:53 -06:00
Matt Mackall
edf7079d23 merge with stable 2012-02-25 16:48:07 -06:00
Patrick Mezard
aa60a56d96 log: restore cache used by --copies
The {filelog -> linkrev -> copyfrom} cache was refactored and broken by:

  changeset:   10060:cc8d195282c7
  user:        Patrick Mezard <pmezard@gmail.com>
  date:        Sun Dec 13 18:06:24 2009 +0100
  summary:     templatekw: change {file_copies} behaviour, add
               {file_copies_switch}

With --copies, this cache is accessed for every touched file of every revision.
Unfortunately it is recreated for every revision, which means filelogs are
parsed again. This patch makes the cache global again for all revisions.

A couple of indicative timings of "hg log --copies", before and after:

hg:                       44s /     5s
mozilla --limit 10000:  3m51s /  2m32s
mozilla:               23m46s / 12m23s

I do not know any good tool to trace memory consumption of these runs for
comparisons. Watching the full mozilla run in top, the process did not seem to
misbehave.
2012-02-25 19:39:55 +01:00
Matt Mackall
ee77ef5137 merge with stable 2012-02-24 16:16:48 -06:00
Matt Mackall
ea01a95d30 graft: use proper revisions for copy detection (issue3265) 2012-02-24 16:09:15 -06:00
Matt Mackall
8ddc445e67 status: fix format field thinko 2012-02-22 15:22:12 -06:00
Matt Mackall
31ad230c52 pull: backout change to return code
This bit a number of people.
2012-02-10 16:09:30 -06:00
Matt Mackall
902bee47a8 pull: return 1 when no changes found (BC)
Currently we have the following return codes if nothing is found:

                commit   incoming    outgoing      pull     push
intended           1        1           1            1       1
documented         1        1           1            0       1
actual             1        1           1            0       1

This makes pull agree with the rest of the table and makes it easy to
detect "nothing was pulled" in scripts.
2012-01-30 16:01:54 -06:00
Matt Mackall
1c8e8627b0 push: don't treat bookmark as a found change
Treating bookmarks as a found change results in confusing
documentation or output and is less useful for scripting.
2012-01-30 15:56:35 -06:00
Pierre-Yves David
605e1c8bba phase: accept old style revision specification 2012-01-30 18:06:57 +01:00
Matt Mackall
2157179ce3 push: return 1 if no changes found (issue3228)
Currently we have the following return codes if nothing is found:

                commit   incoming    outgoing      pull     push
intended           1        1           1            1       1
documented         1        1           1            0       1
actual             1        1           1            0       0

This fixes the lower-right entry.
2012-01-30 11:32:09 -06:00
Matt Mackall
79aca17050 push: more precise failure check on subrepo push
This will let us distinguish between nothing to push and push failed
2012-01-30 11:26:20 -06:00
Matt Mackall
8c3fad2adc push: return 0 when updating bookmarks 2012-01-30 11:23:17 -06:00
Matt Mackall
b7fe2d0ec5 bookmarks: move current bookmark on update -u and bare pull -u (issue3222)
Currently, this won't update when a #branch spec is in the URL
2012-01-29 14:07:45 -06:00
Kevin Bullock
d1f8c5d7da update: note updated bookmark
This brings update in line with pull: we notify the user when an action
indirectly updates a bookmark.
2012-01-27 13:12:56 -06:00
Augie Fackler
4a3654d428 resolve: mention merge-tools topic in help 2012-01-27 14:19:32 -06:00
Matt Mackall
e4d11ad28c scmutil: unify some 'no changes found' messages
This keeps the wording more consistent for secret csets
2012-01-25 17:14:08 -06:00
Alain Leufroy
b62e38b78d bundle: display info about secret changets while no sharable changeset found 2012-01-25 19:05:16 +01:00
Jens Bäckman
a286708816 help: mark strings for translation 2012-01-25 14:06:04 -06:00
Matt Mackall
4264cfcad0 formatter: convert status command 2012-02-20 16:42:51 -06:00
Matt Mackall
bd7d3adcb4 merge with stable 2012-02-10 17:09:23 -06:00
Patrick Mezard
165a91747d debugrevspec: mention --verbose to print the parsed tree 2012-02-10 13:50:13 +01:00
Patrick Mezard
e1749878c6 phase: when phase cannot be reduced, hint at --force and return 1 (BC)
Before, trying to change the phase of a "public" node to "draft" would result
in:

  $ hg phase --draft .
  no phases changed
  [0]

With this patch:

  $ hg phase --draft .
  cannot move 1 changesets to a more permissive phase, use --force
  no phases changed
  [1]

On partial failures, the exit status is now 1 instead of 0 and the number of
changed nodes is displayed while it was only with --verbose. It seems useful to
tell the user that despite the apparent failure, something changed.

  $ hg phase --draft '5 or 7'
  cannot move 1 changesets to a more permissive phase, use --force
  phase changed for 1 changesets
  [1]
2012-02-08 20:00:52 +01:00
Matt Mackall
1b38343e48 update: just merge unknown file collisions
The unknown file collision rule was introduced as an extension of the
"should be clean when merging" rule. Unfortunately, it got applied to
the normal update path, which should be happy to merge local changes.

This patch gives us merges for unknown file collisions on update,
while preserving abort for merge and update -c.
2012-02-09 17:54:47 -06:00
Matt Mackall
1ceb79342c update: use normal update path with --check (issue2450)
This avoids clobbering unknown files on update by not using overwrite mode.
2012-02-09 13:16:20 -06:00
Pierre-Yves David
489da655c0 phase: alway return a value
With the previous code, the phase command was returning None when displaying
phase and 0 or 1 when moving them.

This seemed an bit odd and displaying phase return 0 too now.
2012-01-22 21:30:09 +01:00
Matt Mackall
a57d42adc3 bookmarks: correct correction of -i 2012-01-20 15:25:39 -06:00
Idan Kamara
9abd35e5ee commands: drop exclamation mark in abort message 2012-01-20 23:05:14 +02:00
Kevin Bullock
0ffedb7ebf update: note ways to avoid moving bookmark 2012-01-19 16:10:26 -06:00
Matt Mackall
e52f0054ce bookmarks: make -i summary simpler and more accurate 2012-01-20 14:19:13 -06:00
Kevin Bullock
c4ab5bfe8b bookmarks: clarify help for -i/--inactive 2012-01-19 16:05:01 -06:00
Matt Mackall
0e96c1d311 bookmarks: automatically advance bookmark on naked update (BC) (issue2894) 2012-01-19 14:07:48 -06:00
David M. Carr
560a2fff89 forget: fix subrepo recursion for explicit path handling
When support for handling explicit paths in subrepos was added to the forget
command (155b89136ae7), subrepo recursion wasn't taken into account.  This
change fixes that by pulling the majority of the logic of commands.forget into
cmdutil.forget, which can then be called from both there and subrepo.forget.
2012-01-17 19:10:59 -05:00
David M. Carr
375e0ca3cf add: fix subrepo recursion for explicit path handling
When support for handling explicit paths in subrepos was added to the add
command (825c4cefde4b), subrepo recursion wasn't taken into account.  This
change adds an explicitonly argument to cmdutil.add to allow controlling which
levels of recursion should include only explicit paths versus all matched
paths.
2012-01-17 19:10:58 -05:00
Pierre-Yves David
1b049b22f5 phase: report phase movement
When used in "set" mode, the phase command now display the number of changeset
who changed phase.
2012-01-17 20:43:41 +01:00
Mads Kiilerich
71865d2b26 tag: lock before tagging 2012-01-13 01:19:07 +01:00
Mads Kiilerich
98451cba89 debugbuilddag: lock repo before starting transaction 2012-01-13 01:19:07 +01:00
Olav Reinert
c5f1adceef help: fix column alignment in "hg help" output
The output of "hg help" is changed to ensure that the column containing
descriptions of commands, extensions, and other topics is correctly alignmened.
2012-01-11 18:14:55 +01:00
Martin Geisler
1c373fe3fb commands: partial backout of 50aa11ad0b77 2012-01-13 14:52:47 +01:00
Martin Geisler
5f85497f3f phase: add metavar to -r help text 2012-01-13 11:53:51 +01:00
Martin Geisler
03f35c36c9 phase: the REV argument can be repeated 2012-01-13 11:50:06 +01:00
Martin Geisler
4c9bf5eec4 commands: no need to rename merge and phases on import 2012-01-13 11:38:49 +01:00
Martin Geisler
f194db061a phase: there is actually no -C option 2012-01-13 11:34:09 +01:00
Martin Geisler
312014ab5d phase: use standard syntax for command line flags
We don't mark them as literal text and we mention the short option the
first time we talk about a given flag.
2012-01-13 11:29:47 +01:00
Martin Geisler
c8fd9fad8f phase: fix RST markup (use `...` for literal text) 2012-01-13 11:26:24 +01:00
Martin Geisler
57ec63f3c0 phase: lowercase option help, rephrase slightly 2012-01-13 11:23:45 +01:00
Pierre-Yves David
e929cd5e49 discovery: introduce outgoing object for result of findcommonoutgoing
Simplifies client logic in multiple places since it encapsulates the
computation of the common and, more importantly, the missing node lists.

This also allows an upcomping patch to communicate precomputed versions of
these lists to clients.
2012-01-09 03:47:16 +01:00
Pierre-Yves David
2362e6fe6c commands: make bundle use heads computed by findoutgoing 2012-01-09 04:16:00 +01:00
Martin Geisler
e0542a7108 commands: bump copyright year 2012-01-11 15:51:02 +01:00
Matt Mackall
7ea3d8e9f3 phase: mark messages for i18n 2012-01-10 16:36:36 -06:00
Matt Mackall
7025e1c3b0 phase: fix up help string 2012-01-10 16:36:33 -06:00
Matt Mackall
ae28263f4b phase: drop reference to working directory phase 2012-01-10 16:36:32 -06:00
Pierre-Yves David
a2fe028df9 phases: add a phases command to display and manipulate phases 2012-01-10 19:45:35 +01:00
Ion Savin
029e0ada33 annotate: append newline after non newline-terminated file listings
The last line of a non newline-terminated file would mix with the first line of
the next file in multiple-file listings before this patch.

Possible compatibility issue: no longer possible to tell from the annotate
output if the file is terminated by new line or not.
2012-01-10 10:18:19 +02:00
Martin Geisler
fa8ac03b58 merge with stable 2012-01-06 11:43:17 +01:00
Martin Geisler
649b8283da commands: add link to addremove in commit help text 2012-01-06 11:15:32 +01:00
Matt Mackall
dea868ff61 cmdutil: simplify duplicatecopies 2012-01-05 20:35:10 -06:00
Matt Mackall
48738cad22 copies: rewrite copy detection for non-merge users
The existing copy detection API was designed with merge in mind and
was ill-suited for doing status/diff. The new pathcopies
implementation gives more accurate, easier to use results for
comparing two revisions, and is much simpler to understand.

Test notes:

- test-mv-cp-st.t results finds more renames in the reverse direction now
- test-mq-merge.t was always wrong and duplicated a copy in diff that
  was already present in one of the parent revisions
2012-01-04 17:55:30 -06:00
Matt Mackall
9bfa890ee6 copies: split the copies api for "normal" and merge cases (API) 2012-01-04 15:48:02 -06:00
Matt Mackall
c19e8e450d merge with stable 2012-01-03 17:13:03 -06:00
Matt Mackall
8ba239a418 grep: make multiline mode the default (BC)
This is a much more logical way to deal with ^ and $.
Old ^ and $ behavior are available with \A and \Z.
2012-01-03 15:48:58 -06:00
Matt Mackall
61f1d2e359 rollback: clarify --force text (issue3175) 2011-12-29 14:02:18 -06:00
Matt Mackall
c9f57cde0f merge with stable 2011-12-29 14:45:18 -06:00
FUJIWARA Katsunori
9dd2a411a7 i18n: use "encoding.lower()" to normalize specified keywords for log searching
some problematic encoding (e.g.: cp932) uses ASCII alphabet characters
in byte sequence of multi byte characters.

"str.lower()" on such byte sequence may treat distinct characters as
same one, and cause unexpected log matching.

this patch uses "encoding.lower()" instead of "str.lower()" to
normalize strings for compare.
2011-12-25 20:35:16 +09:00
Matt Mackall
11aa73a675 merge with stable 2011-12-22 15:56:27 -06:00
Kevin Bullock
0fb78c49bd graft: use consistent language in help
Removes the word 'aborted' from the 3rd paragraph in favor of
'interrupted', the same word used in the description of the
-c/--continue switch. The word 'interrupted' is also consistent with
the help for rebase.
2011-12-20 14:11:14 -06:00
Martin Geisler
034d08dce7 status: add missing ":" to help text 2011-12-15 11:13:38 +01:00
Matt Mackall
a69962e18c branch: warn on branching 2011-12-08 14:32:44 -06:00
Matt Mackall
d91862b8e5 branch: move note about permanence to the top, add 'global' 2011-12-05 17:09:11 -06:00
Patrick Mezard
942cefafa6 import: fix parent selection when importing merges
With "wp1" and "wp2" the current working directory parents, "p1" and "p2" the
patch parents and "parents" the resulting commit parents, the current behaviour
is:

--bypass --exact p2 parents
0        0       0  [wp1, wp2]
0        0       1  [wp1, wp2]/buggy
0        1       0  [p1]
0        1       1  [p1, p2]
1        0       0  [wp1, wp2]
1        0       1  [p1, p2]
1        1       0  [p1]
1        1       1  [p1, p2]

The original behaviour before 1f543fd375c5 was:

--bypass --exact p2 parents
0        0       0  [wp1, wp2]
0        0       1  if p1 == wp1 then [p1, p2] otherwise [wp1, wp2]
0        1       0  [p1]
0        1       1  [p1, p2]

This patch restores the previous behaviour when --bypass is not set, and align
--bypass behaviour when --exact is not set with merge diffs.
2011-11-16 12:53:10 +01:00
Stefano Tortarolo
f195f71994 graft: disallow grafting grafted csets in specific situations (issue3091)
In particular, we do not allow:
- grafting an already grafted cset onto its original branch
- grafting already grafted csets with the same origin onto each other
2011-11-12 14:00:25 +01:00
Stefano Tortarolo
dfee711e26 graft: preserve original source in subsequent grafts 2011-11-12 13:15:40 +01:00
Stefano Tortarolo
a179a7e151 graft: mark a string for translation 2011-11-08 21:31:39 +01:00
Matt Mackall
b066b57e3c backout 17bc9a6bb165 (issue3077) (issue3071)
Using util.realpath turns out to create complex issues on both Mac and
Windows. Back this change out for the release.
2011-10-29 11:02:23 -05:00
Peer Stritzinger
ed0c1f398e revert: fix missing removes when parent was changed in dirstate
When dirstate parent is changed with dirstate.setparent before a
revert so it no longer points to where the dirstate refered to, revert
does not remove all files it should:

Revert to a different revision needs also to remove files that are not
found through disptables and not in the context or parent manifest.
2011-10-26 18:47:12 +02:00
Matt Mackall
b7f097bf54 graft: fix duplicate filter logic 2011-10-24 16:57:14 -05:00
Matt Mackall
0d1e03e15b graft: fix duplicate scan message 2011-10-24 16:57:14 -05:00
Matt Mackall
11a871ed47 graft: fix formatting of message 2011-10-24 12:09:12 -05:00
Thomas Arendsen Hein
51c498ead0 consistency: use util.realpath instead of os.path.realpath where useful
exceptions:
  hg: os.path.realpath used before util can be imported
  tests/run-tests.py: may not import mercurial modules
2011-10-24 13:51:24 +02:00
Kevin Bullock
dd00f9e122 import: abort usefully if no patch name given 2011-10-21 11:10:43 -05:00
Martin Geisler
acfa971cf1 subrepos: abort commit by default if a subrepo is dirty (BC)
This changeset flips the default value of ui.commitsubrepos setting
from True to False and adds a --subrepos flag to commit.

The commit, status, and diff commands behave like this with regard to
recusion and the ui.commitsubrepos setting:

          | recurses      | recurses
          | by default    | with --subrepos
  --------+---------------+----------------
  commit: | commitsubrepo | True
  status: | False         | True
  diff:   | False         | True

By changing the default from True to False, the table becomes
consistent in the two columns:

* without --subrepos on the command line, commit will abort if a
  subrepo is dirty and status/diff wont show changes inside subrepos.

* with --subrepos, all three commands will recurse.

A --subrepos flag on the command line overrides the config settin.g
2011-10-21 00:33:08 +02:00
Wagner Bruna
d4e8e13b0d import: add i18n context 2011-10-18 09:38:10 -02:00
Mads Kiilerich
06d30b903b grep: correct handling of matching lines without line ending (issue3050)
Matching lines without trailing '\n' was missing the last character.

That seems to have been an unintended side effect of 8abe3f27975c.
The test in c21748e4cd4d documents the bad behaviour.
2011-10-16 01:26:06 +02:00
Thomas Arendsen Hein
5a6f0ca4ac commands: use separate try/except and try/finally as needed for python2.4
69d55e9a084a introduced a try/except/finally block, which breaks compatibility
with python2.4
2011-10-16 11:12:59 +02:00
Angel Ezquerra
16f9562667 revert: warn that subrepos cannot be reverted
(tests added by mpm)
2011-10-15 01:06:52 +02:00
Matt Mackall
7751048134 graft: use status verbosity for reporting grafts 2011-10-14 15:40:50 -05:00
Angel Ezquerra
30a511a833 push: propagate --new-branch and --ssh options when pushing subrepos
Up until now the all the push command options were ignored when pushing
subrepos. In particular, the fact that the --new-branch command was not passed
down to subrepos made it not possible to push a repo when any of its
subrepos had a new branch, even if you used the --new-branch option of the push
command.

In addition the error message was confusing since it showed the following hint:
"--new-branch hint: use 'hg push --new-branch' to create new remote branches".
However using the --new_branch flag did not fix the problem, as it was ignored
when pushing subrepos.

This patch passes the --new-branch and --ssh flags to every subrepo that is
pushed.

Issues/Limitations:

- All subrepo types get these flags, but only the mercurial subrepos use them.
- It is no longer possible to _not_ pass down these flags to subrepos when
pushing:
   * An alternative would be to introduce a --subrepos flag that should be
used to pass down these flags to the subrepos.
   * If we did this, it could make sense to make the --force flag respect this
   new --subrepos flag as well for consistency's sake.
- Matt suggested that the ssh related flags could also be passed down to
subrepos during pull and clone. However it seems that it would be the "update"
command that would need to get those, since subrepos are only pulled on update.
In any case I'd prefer to leave that for a later patch.
2011-09-29 17:20:04 +02:00
Matt Mackall
31beaa1cd1 merge with crew 2011-12-15 14:24:38 -06:00
Martin Geisler
d6b9b24fa1 merge with stable 2011-12-15 16:26:33 +01:00
Ion Savin
b96d2a90cd annotate: show full changeset hash when invoked with --debug and -c 2011-12-09 14:14:30 +02:00
Matt Mackall
a968007692 merge with stable 2011-12-08 16:01:44 -06:00
Kevin Bullock
49b349ede1 bookmarks: clarify help for use of merge and update 2011-12-07 11:23:13 -06:00
Kevin Bullock
4b1f198355 merge: make 'nothing to merge' aborts consistent
Makes the 'nothing to merge' abort messages in commands.py consistent with
those in merge.py. Also makes commands.merge() and merge.update() use hints.
The tests show the changes.
2011-12-07 11:23:01 -06:00
Kevin Bullock
d434bb6e1a merge: remove excess creation of changectx 2011-12-07 11:22:57 -06:00
Matt Mackall
239b73ab8c bookmarks: mark divergent bookmarks with book@pathalias when source in [paths] 2011-12-07 16:19:39 -06:00
Matt Mackall
e82c2e671f merge with stable 2011-12-05 17:48:40 -06:00
Pierre-Yves David
5ac8c7b10a addchangegroup: remove the lock argument on the addchangegroup methods
This argument is no longer require. post lock release code is now handled with
dedicated post release callback code in lock itself.
2011-11-28 01:32:13 +01:00
Mads Kiilerich
498fe2dc88 id: add command line options for handling ssh and https urls 2011-11-26 00:10:12 +01:00
Patrick Mezard
a50918f3cf status: support revsets with --change 2011-11-24 11:38:16 +01:00
Patrick Mezard
cc3315778f annotate: support diff whitespace filtering flags (issue3030)
splitblock() was added to handle blocks returned by bdiff.blocks() which differ
only by blank lines but are not made only of blank lines. I do not know exactly
how it could happen but mdiff.blocks() threshold behaviour makes me think it
can if those blocks are made of very popular lines mixed with popular blank
lines. If it is proven to be wrong, the function can be dropped.

The first implementation made annotate share diff configuration entries. But it
looks like users will user -w/b for annotate but not for diff, on both the
command line and hgweb. Since the latter cannot use command line entries, we
introduce a new [annotate] section duplicating the diff whitespace options.
2011-11-18 12:04:31 +01:00
Matt Mackall
75db0d196a merge with stable 2011-11-17 16:53:17 -06:00
Mads Kiilerich
82bc04a832 forget: use forward slashes for internal paths
forget into a subrepo failed on windows because pathes were joined with \.
2011-11-15 02:44:55 +01:00
Kevin Bullock
8db1185fdd bookmark: remove excess creation of changectx's 2011-08-17 08:55:01 -05:00
Kevin Bullock
9fce7fc5a8 bookmark: same order for options and code 2011-08-17 08:49:40 -05:00
David M. Carr
f9ef6cf73b forget: support forgetting explicit paths in subrepos
Change the behavior of the forget command such that explicit paths in
subrepos are handled by forgetting the file in the subrepo. This eliminates the
previous behavior where if you called "hg forget" for an explicit path in a
subrepo, it would state that the file is already untracked.
2011-11-09 19:46:51 -05:00
Matt Mackall
8f2b7260c4 merge with stable 2011-11-10 11:00:27 -06:00
Mads Kiilerich
58e471712f windows: use umask 022 in debugstate output
debugstate would always report files as mode 666 or 777 on Windows.

umask is not used on Windows, but faking and using a defalt value of 022
matches what the test suite uses on Unix.
2011-11-07 03:14:54 +01:00
Matt Mackall
5fdb728e0d log: hide hidden option until it actually does something 2011-11-06 14:40:31 -06:00
Matt Mackall
44b7e0d151 log: hide some low-utility options 2011-11-02 15:06:40 -05:00
Matt Mackall
fe45fca7d5 localrepo: convert various repo.set() users to repo.revs() 2011-11-02 13:51:16 -05:00
Matt Mackall
3c9792e3dc graft: add examples and information about copied metadata 2011-10-12 18:59:59 -05:00
Matt Mackall
1841aff181 graft: add --continue support 2011-10-12 18:48:57 -05:00
Matt Mackall
d5e94e6c90 graft: add user, date, and tool options 2011-10-12 18:46:23 -05:00
Matt Mackall
0069040fa2 graft: add --edit 2011-10-12 18:46:03 -05:00
Matt Mackall
06ac7c8606 graft: add initial implementation 2011-10-12 18:45:36 -05:00
Pierre-Yves David
ad8f123b6d resolve: update documentation to mention the .orig backup 2011-10-11 18:48:45 +02:00
Matt Mackall
944b7f7b5c pyflakes: clean up some import noise 2011-10-11 23:16:05 -05:00
Matt Mackall
72fd6652f4 import: add --edit switch 2011-10-11 08:32:04 -05:00
Matt Mackall
0649c57d76 branch: fix formatting of help note 2011-10-08 15:19:05 -05:00
Matt Mackall
36ed787d41 backout: deprecate/hide support for backing out merges
This has never worked usefully:

- it can't undo a completely unwanted merge, as it leaves the merge in the DAG

- it can't undo a faulty merge as that means doing a merge correctly,
  not simply reverting to one or the other parent

Both of these kinds of merge also require coordinated action among
developers to avoid the bad merge continuing to affect future merges,
so we should stop pretending that backout is of any help here.

As backing out a merge now requires a hidden option, it can't be done
by accident, but will continue to 'work' for anyone who's already
dependent on --parent for some unknown reason.
2011-10-08 14:18:18 -05:00
Matt Mackall
f26269e791 backout: add a note about not working on merges 2011-10-08 13:28:13 -05:00
Matt Mackall
631fb3ec67 backout: mark some help verbose 2011-10-08 13:23:57 -05:00
Matt Mackall
6435383b32 help: generate command help into a single RST string for formatting 2011-10-07 17:08:24 -05:00
Matt Mackall
58c81fa35e help: unify the two -v notes for command help 2011-10-07 16:36:54 -05:00
Matt Mackall
f315765fd4 debuginstall: report the template path 2011-10-07 15:36:50 -05:00
Greg Ward
eb46fccd3a import: wrap a transaction around the whole command
Now 'rollback' after 'import' is less surprising: it rolls back all of
the imported changesets, not just the last one. As an extra added
benefit, you don't need 'rollback -f' after 'import --bypass', which
was an undesired side effect of fixing issue2998 (f9f52d71c33b)..

Note that this is a different take on issue963, which complained that
rollback after importing multiple patches returned the working dir
parent to the starting point, not to the second-last patch applied.
Since we now rollback the entire import, returning the working dir to
the starting point is entirely logical. So this change also undoes
b12d79024900, the fix to issue963, and updates its tests accordingly.

Bottom line: rollback after import was weird before issue963,
understandable since the fix for issue963, and even better now.
2011-10-02 14:34:28 -04:00
Greg Ward
dc0fd85c49 import: improve error reporting
When applying a series of patch files, it's nice to be explicitly told *which* file is broken.
2011-10-01 21:52:44 -04:00