Commit Graph

8046 Commits

Author SHA1 Message Date
Adrian Buehlmann
aff67e5bff update: clarify that update changes the parent revison 2011-06-24 10:51:05 +02:00
Mads Kiilerich
ed0023acf6 revset: fix aliases with 0 or more than 2 parameters
The existing code seemed to have incorrect assumptions about how parameter
lists are represented by the parser.

Now the match and replace functions have been merged and simplified by using
getlist().
2011-06-22 01:55:00 +02:00
Peter Arrenbrecht
aa36fb062f match: fix bug caused by refactoring in fb457d08da0b 2011-06-23 14:40:57 +02:00
Adrian Buehlmann
c1d402dc5f revert: be more helpful on uncommitted merges
BEFORE:
   $ hg revert
   abort: no files or directories specified
   (use --all to discard all changes)

 AFTER:
   $ hg revert
   abort: no files or directories specified
   (uncommitted merge, use --all to discard all changes, or 'hg update -C .' to abort the merge)
2011-06-22 15:34:33 +02:00
Adrian Buehlmann
a6cb8dc613 opener: add self._audit (issue2862) 2011-06-22 10:13:44 +02:00
Idan Kamara
046eba79ef cmdserver: write the hello message as one chunk on the 'o' channel
This is a guaranteed by the protocol: clients know they need to read one chunk
off of the 'o' channel and treat that as the hello message.

They should ignore fields they don't recognize so they stay compatible with
new versions of the server in case we decide to add something.
2011-06-22 17:13:04 +03:00
Mads Kiilerich
1794513e71 fileset: copied takes no arguments 2011-06-24 01:10:35 +02:00
Mads Kiilerich
7cf147b1a4 revset and fileset: fix typos in parser error messages 2011-06-22 01:55:00 +02:00
Mads Kiilerich
9f3fc0b58e fileset: use ParseError pos field correctly
The pos field is intended to describe the position of the error - it should not
be used for other potentially interesting information.
2011-06-24 00:18:41 +02:00
Mads Kiilerich
8ef684c2fc revset: fix parameter name in implementation of follow() 2011-06-24 00:18:06 +02:00
Kevin Bullock
99e4d74da2 revert: be more explicit that changes are lost
BEFORE:
   $ hg revert
   abort: no files or directories specified
   (use --all to revert all files)

 AFTER:
   $ hg revert
   abort: no files or directories specified
   (use --all to discard all changes)
2011-06-20 22:15:52 -05:00
Idan Kamara
27964e7418 dispatch: do not close the request repo
Closing here means we've closed the repo passed to us in the request,
which is not our responsibility.

This is essential for bundlerepo, and possibly other localrepository
subclasses who do something in their close().
2011-06-21 17:08:21 +03:00
Idan Kamara
2a64fb6699 hook: write hook output to ui fout descriptor
output on stderr will also be written to ui.fout, unless sys.__stdout__
is passed in (see util.system), thus not changing previous behavior.

This fixes a bug where hooks run through the command server would mess up
with the command protocol, sending non-channeled data to the client.
2011-06-21 16:55:21 +03:00
David Soria Parra
881ac28f17 i18n: remove translation of debug messages 2011-06-21 18:35:13 +02:00
Idan Kamara
29341e1294 cmdserver, runcommand: properly handle the client sending no arguments
No real reason for a client to do this, but still possible.

Previously if the client sent no arguments, a list with an empty string ['']
would be used as the arguments to dispatch, which would cause hg to complain
about an ambiguous command.

Instead, we simply check for no arguments and use an empty list instead (which
is equivalent to invoking hg with no args on the command line).
2011-06-21 15:38:10 +03:00
Idan Kamara
1d2537f10a cmdserver: don't raise EOFError when trying to read 0 bytes from the client 2011-06-21 15:13:39 +03:00
Martin Geisler
01ba8f6e18 Backed out changeset 48c996bf6ba4
Debug messages should not be translated.
2011-06-21 14:57:17 +02:00
David Soria Parra
81153f2f12 dispatch: translate alias debugging messages 2011-06-21 13:24:19 +02:00
Mads Kiilerich
473bcd3ed1 parsers: fix localization markup of parser errors 2011-06-21 00:17:52 +02:00
Wagner Bruna
6e3f89657d fileset: add i18n hints for keywords 2011-06-27 13:48:25 -03:00
Ollie Rutherfurd
593b23dd2b fileset: use correct function name for hgignore in docstring
docstring refereed to "resolved" instead of "hgignore"
2011-06-19 22:33:25 -04:00
Matt Mackall
6f9d587fae url: catch UNC paths as yet another Windows special case (issue2808) 2011-06-20 16:45:33 -05:00
Peter Arrenbrecht
a276877b67 treediscovery: always return all remote heads
Old discovery only returned incoming heads, not all of them (for
changegroupsubset). New discovery must always return all of the remote heads
(for getbundle). I failed to properly adjust treediscovery in 43f4c1113c8d
when introducing setdiscovery.

The actual observable problem was 'remote: unsynced changes' when trying
to push a cset on one named branch to a server with a new cset on another
named branch. This scenario is now tested in test-treediscovery.t.
2011-06-20 14:11:01 +02:00
Sune Foldager
ec11e30560 config.sortdict: override clear method
Overrides dict.clear. It's not currently used, but was broken for sortdict.
Contributed by Stepan Koltsov <yozh@mx1.ru>
2011-06-20 10:51:37 +02:00
Peter Arrenbrecht
97a6442c24 patch: fix typo in variable name 2011-06-20 09:30:03 +02:00
Wagner Bruna
53d990ed78 help/revsets: revset aliases can be defined on any config file 2011-06-17 19:28:38 -03:00
Wagner Bruna
ff9f5e4543 help/revsets: clean up whitespace between paragraphs 2011-06-17 19:27:40 -03:00
Wagner Bruna
5fc947dc55 help/config: mention [revsetalias] section 2011-06-17 19:14:47 -03:00
Thomas Arendsen Hein
99f096ba63 fileset: add missing whitespace around operator 2011-06-19 11:43:40 +02:00
Matt Mackall
c4d41451a4 fileset: drop backwards SI size units
- the power of 2 ones should be kiB, MiB, etc.
- the power of 10 ones (SI standard) should be kB, MB, but we're currently
  using the industry traditional units elsewhere
2011-06-18 20:49:07 -05:00
Matt Mackall
c8c26720e0 fileset: add a help topic
Add crosslinking with patterns topic.
2011-06-18 16:53:49 -05:00
Matt Mackall
f0947299d9 fileset: add copied predicate 2011-06-18 16:53:49 -05:00
Matt Mackall
d2639d0874 fileset: add encoding() predicate 2011-06-18 16:53:49 -05:00
Matt Mackall
dea358aea5 fileset: add size() predicate 2011-06-18 16:53:49 -05:00
Matt Mackall
097fbc7efc fileset: add grep predicate 2011-06-18 16:53:49 -05:00
Matt Mackall
424cb390f7 fileset: add some function help text 2011-06-18 16:53:49 -05:00
Matt Mackall
cd8a73fe93 fileset: add hgignore 2011-06-18 16:53:49 -05:00
Matt Mackall
4ce9da8ec0 fileset: add resolved and unresolved predicates 2011-06-18 16:53:49 -05:00
Matt Mackall
5b901d4a0d fileset: prescan parse tree to optimize status usage
We only call status if needed to avoid walking the working directory
or comparing manifests.

Similarly, we scan for whether unknown or ignored files are mentioned
so we can include them.
2011-06-18 16:53:49 -05:00
Matt Mackall
5761c899b5 fileset: add support for file status predicates
This forcibly walks the tree looking for unknown and ignored files,
which is suboptimal. A better approach would scan the tree first to
find required status components and skip the status check entirely if
it's unused.
2011-06-18 16:53:49 -05:00
Matt Mackall
12efed7dfc fileset: add some basic predicates 2011-06-18 16:53:49 -05:00
Matt Mackall
1dc7f878ce match: introduce basic fileset support 2011-06-18 16:53:44 -05:00
Matt Mackall
b662345d91 match: allow passing a context object to match core 2011-06-18 16:52:51 -05:00
Matt Mackall
3c219ce0dc fileset: drop matchfn
This is now built into contexts
2011-06-18 16:52:51 -05:00
Matt Mackall
deda228cd7 scmutil: match no longer accepts repo objects 2011-06-18 16:52:51 -05:00
Matt Mackall
5ab97592f7 scmutil: switch match users to supplying contexts
The most appropriate context is not always clearly defined. The obvious cases:

For working directory commands, we use None
For commands (eg annotate) with single revs, we use that revision

The less obvious cases:

For commands (eg status, diff) with a pair of revs, we use the second revision
For commands that take a range (like log), we use None
2011-06-18 16:52:51 -05:00
Matt Mackall
7fe2a75e90 scmutil: match now accepts a context or a repo 2011-06-18 16:52:51 -05:00
Matt Mackall
3ca86d272f context: add a match builder method
This is groundwork for matching against filesets in contexts
2011-06-18 16:52:51 -05:00
Wagner Bruna
6aa802687e help/hgignore: refer to the builtin help instead of external URLs 2011-06-17 18:24:54 -03:00
Mads Kiilerich
70902bb721 sslutil: make messages for Python without certificate handling more helpful
We now explain why there is no certificate to verify and do not give hints
about cacerts when they can't be used anyway.
2011-06-18 01:08:54 +02:00
Nicolas Bareil
db42995f2e sslutil: fall back to commonName when no dNSName in subjectAltName (issue2798)
Any entries in subjectAltName would prevent fallback to using commonName, but
RFC 2818 says:

    If a subjectAltName extension of type dNSName is present, that MUST
    be used as the identity. Otherwise, the (most specific) Common Name
    field in the Subject field of the certificate MUST be used.

We now only consider dNSNames in subjectAltName.

(dNSName is known as 'DNS' in OpenSSL/Python.)
2011-06-18 01:03:03 +02:00
Augie Fackler
e777b9d80a svn subrepos: work around checkout obstructions (issue2752)
We do this by ensuring the working copy is clean and then blowing away
the working copy and replacing it with one from the desired path. We
could probably use 'svn switch' to do this more efficiently, but
there's some subtle logic required to get that right and this is
more likely to work reliably.
2011-06-17 15:22:50 -05:00
Augie Fackler
a3d0340408 update: check wc.dirty() before setting overwrite=True
merge.update() was missing a few dirtiness checks from workingcontext,
including subrepo cleanliness checks. Using wc.dirty() instead of
one-off checks for various forms of dirtiness will be significantly
safer.
2011-06-17 15:21:02 -05:00
Steve Borho
b9bfb1f58d tags: don't allow environment errors to be raised from _writetagscache
See https://bitbucket.org/tortoisehg/thg/issue/719
2011-06-16 15:26:17 -05:00
Wagner Bruna
c100667e38 help/config: replace docutils markup 2011-06-17 13:31:23 -03:00
Matt Mackall
eb5cc8dd93 config: undo change of empty line definition
We don't allow spaces in front of comment markers
2011-06-17 15:36:56 -05:00
Patrick Mezard
86e3700676 patch: make filestore store data in memory and fallback to fs 2011-06-17 20:33:02 +02:00
Wagner Bruna
dc3642eb62 help/config: quote config section names consistently 2011-06-16 12:52:37 -03:00
Wagner Bruna
c203edb0e4 help/config: fix small typo 2011-06-16 12:42:19 -03:00
Wagner Bruna
eccfac28f2 help/config: do not refer to config files as hgrc files 2011-06-16 12:30:57 -03:00
Wagner Bruna
a463f7c11f help/config: fix 'Mercurial' casing 2011-06-16 12:30:44 -03:00
Thomas Arendsen Hein
282b06cd6f revset: add desc(string) to search in commit messages
Like keyword(), but does not search in filenames and users.
No grepdesc() or descgrep() added, because it might be bad to introduce
grepfoo() versions of too many string searches.
2011-06-16 22:47:34 +02:00
Thomas Arendsen Hein
f770eadd10 revset: update sorting of symbols 2011-06-16 22:03:26 +02:00
Matt Mackall
6e8d242aa0 http: fix variable name in unexpected response message 2011-06-16 14:33:06 -05:00
Idan Kamara
40027596a8 serve: add --cmdserver option to communicate with hg over a pipe 2011-06-03 17:27:41 +03:00
Idan Kamara
3910bf241e localrepo: don't attempt to open .hgtags twice if the error isn't ENOENT 2011-06-15 23:15:04 +03:00
Pierre-Yves David
d3dabeeb99 log: do not display hidden changeset
We add a --hidden option to display them.
2011-06-16 01:58:00 +02:00
Pierre-Yves David
2b4856c921 hidden: Add `hidden` method for context 2011-06-16 01:57:59 +02:00
Pierre-Yves David
7049209b6a hidden: Add a hiddenrevs attributes to changelog.
This attributes hold the set of all revisions that should be ommited by command
and tools displaying changesets.

This set is given as a hit. Command and tools are responsible to check it in
order to filter they outpur.

Code adding revisions to the set are responsible to the consistency of it's
data.
2011-06-16 01:57:53 +02:00
Matt Mackall
bf73994e3d config: handle comment lines in continuations (issue2854) 2011-06-16 13:24:44 -05:00
Matt Mackall
c96ac75208 http: report unexpected unparsable push responses (issue2777) 2011-06-16 13:24:42 -05:00
Idan Kamara
5e2d608efc dispatch: write shell alias output to ui out descriptor 2011-06-07 13:39:09 +03:00
Idan Kamara
71b4a06c3c commands: use ui descriptors when reading/writing from stdin/out 2011-06-08 14:54:52 +03:00
Idan Kamara
14ffa921d6 cmdutil: return a dummy, closable file object if it cannot be duped
If the ui I/O descriptors aren't real descriptors, they cannot be duped.

Instead, we return a wrapper object that behaves the same, and
can be closed (by overriding close and doing nothing).
2011-06-15 23:50:33 +03:00
Idan Kamara
936b803233 cmdutil: use ui descriptors in makefileobj 2011-06-08 14:54:52 +03:00
Idan Kamara
4f72223e4d cmdutil, logmessage: use ui.fin when reading from '-' 2011-06-08 14:54:52 +03:00
Wagner Bruna
acc5952bf3 dagutil: fix missing import of i18n._ 2011-06-15 17:04:06 -03:00
Martin Geisler
213ba1f97d manifest: use "\0" instead of "\000"
Though both give the same result (a NUL byte), I found that I tend to
read "\000" as "\0" + "00", which is something completely different.

I did not change the occurance of "\000" in archival.py since there
are other octal constants in that file.
2011-06-16 08:49:26 +02:00
Martin Geisler
0e27878c46 commands: add pointer to bookmarks command in branch help 2011-06-15 17:25:58 +02:00
Martin Geisler
d70abc7125 glossary: add entry for "Bookmark" 2011-06-15 17:10:26 +02:00
Martin Geisler
790be68aef glossary: add entry for "Tag" 2011-06-15 17:10:16 +02:00
Peter Arrenbrecht
9a2d2f747c setdiscovery: batch heads and known(ownheads)
This means that we now discover both subset conditions (local<remote and
remote<local) in a single roundtrip without ever constructing an actual
sample (which takes a bit of client CPU).
2011-06-14 22:58:00 +02:00
Peter Arrenbrecht
32dcc012d5 wireproto: make a number of commands batchable
Makes lookup, heads, known, branchmap, pushkey, and listkeys batchable.
It could, for instance, be interesting to use this to batch calls to
lookup when a pull or clone has multiple --rev arguments. The next patch
is going to batch heads and known to slightly tune discovery.
2011-06-14 22:56:20 +02:00
Peter Arrenbrecht
0e9696a634 wireproto: add batching support to wirerepository
Adds the plumbing and wire call for batched execution, but does not
batch-enable any methods yet.
2011-06-14 22:52:58 +02:00
Peter Arrenbrecht
9870a43596 wireproto: add basic command batching infrastructure
Note that localbatch will not be used until we actually have a localpeer to
use it with.
2011-06-14 22:51:26 +02:00
Idan Kamara
c2b2fe4489 dispatch: fix for-loop variable name 2011-06-14 20:25:38 +03:00
Stephen Thorne
8176bbbdf9 sslutil: Restore missing imports of socket and httplib to sslutil
Two imports were omitted in the restructure of the code creating
sslutil.py, socket and httplib are required when the 'ssl' module
cannot be imported, restoring these imports allows mercurial to run
on python2.4+2.5.
2011-06-14 13:31:32 +10:00
Idan Kamara
c08a096623 dispatch: assign I/O descriptors from the request to the ui 2011-06-08 14:54:47 +03:00
Idan Kamara
325f77da0a ui: use I/O descriptors internally
and as a result:
- fix webproto to redirect the ui descriptors instead of sys.stdout/err
- fix sshserver to use the ui descriptors
2011-06-08 01:39:20 +03:00
Idan Kamara
e05ad378b0 dispatch: add I/O descriptors to the request 2011-06-07 13:39:09 +03:00
Idan Kamara
d3e4ddd52a ui: add I/O descriptors 2011-06-07 13:39:09 +03:00
Patrick Mezard
fd8786d770 import: add --bypass option
This feature is more a way to test patching without a working directory than
something people asked about. Adding a --rev option to specify the parent patch
revision would make it a little more useful.

What this change introduces is patch.repobackend class which let patches be
applied against repository revisions. The caller must supply a filestore object
to receive patched content, which can be turned into a memctx with
patch.makememctx() helper.
2011-06-14 23:26:35 +02:00
Patrick Mezard
7350aaca49 import: separate parents selection from working dir update
This will be useful when patching without updating the dirstate
2011-06-14 23:24:40 +02:00
Patrick Mezard
9a9794b348 patch: extend filtestore to store an optional copy source
This will help wrapping filestores in memctx.
2011-06-14 23:24:34 +02:00
Martin Geisler
4ebded65b3 paper/coal: use fixed width for diffstat +/- link
The plus and minus characters are normally not the same width in a
non-monospace font, and this made the line length change when the
diffstat display was toggled.

The square brackets are not rendered in a monospace font to ensure
that they align with the parenthesis on the same line.
2011-06-14 16:38:34 +02:00
Martin Geisler
7e528c7c9a hg: rename opts argument to peeropts in clone
This should make it clearer that the options are used with remoteui
only and are not used otherwise in hg.clone.
2011-06-14 16:33:46 +02:00
Matt Mackall
f0bc90519a hg: move peerschemes back to schemes
This will avoid breaking things with extensions until peers are fully
separated from repos.
2011-06-13 16:25:18 -05:00
Matt Mackall
f241322d80 hg: rearrange peer scheme lookup
There is now only peer scheme lookup. Repository lookup goes through
peer scheme lookup. When peer and repo types are finally separated,
repo lookup will use peer.local() to get a repository object.

The underbar is dropped so that extensions can patch the table.
2011-06-13 14:53:23 -05:00
Idan Kamara
692ba2f2fc forget, remove: don't note on nonexistent file twice
before:
  $ hg forget foo
  foo: No such file or directory
  not removing foo: file is already untracked

after:
  $ hg forget foo
  foo: No such file or directory
2011-06-13 14:56:00 +03:00
Matt Mackall
abe73723fb localrepo: local() returns self
Temporary measure for introducing peers
2011-06-13 12:51:38 -05:00
Idan Kamara
b335d3e278 dispatch: propagate ui command options to the local ui (issue2523)
so the ui object passed to pre/post python hooks has the verbose flag
(and the rest) set correctly
2011-06-13 00:19:26 +03:00
Steven Brown
e159db2556 paper, coal: display diffstat on the changeset page
Displayed in a row of the changeset summary table, underneath the list of
files. When the page is loaded, only the diff summary is displayed. The full
diffstat is only displayed when the [+] link is selected.
2011-06-11 21:24:50 +08:00
Steven Brown
d6246b1341 web: provide diff summary to the changeset page
This is the same message displayed at the end of the "diff --stat" command.
For example, "9 files changed, 1651 insertions(+), 2 deletions(-)".

The webutil.diffstatgen function allows the diffstat data to be lazily
calculated only once and then re-used.
2011-06-11 21:11:43 +08:00
Matt Mackall
aa85ea1250 hg: split peer and repo lookup tables 2011-06-11 14:14:52 -05:00
Patrick Mezard
3680e66462 patch: generalize the use of patchmeta in applydiff()
- Add patchmeta.copy() and emit copies from iterhunks. Modifying patchmeta
  instances in applydiff() makes things simpler.
- Rename selectfile() into makepatchmeta(). It is responsible for creating
  patchmeta for regular patches.
- Pass patchmeta objects to patchfile() directly

patchmeta instances were associated with git patches, for regular patches we
had to pass additional variables to tell the patch intent to patchfile().
Instead, we generate patchmeta for regular patches and pass them. This will
also help with patch filtering by matcher objects.
2011-06-11 14:17:25 +02:00
Patrick Mezard
c72a5b0080 patch: stop updating changed files set in applydiff()
This information is more correctly returned by backends.

The extra updated file removed from test-mq-merge.t output came from changes
from git patches being counted before being really applied in some cases.
2011-06-11 14:14:13 +02:00
Patrick Mezard
6aaca90508 patch: turn patch() touched files dict into a set 2011-06-11 14:14:11 +02:00
Steven Brown
b11012fde3 paper, coal: define the diffstat templates
The templates output the filename, the total number of changes to the file
and a bar graph of the adds and removes. The filename is a link into the diff
output.

The diffstat is not yet displayed, but it can be manually added to the
changeset page template.
2011-06-09 01:19:39 +08:00
Steven Brown
d042b9d9a8 web: provide the file number to the diffstat templates
This allows the diffstat templates to link into the diff output. For example,
the URLs of the first three files within the diff are #l1.1, #l2.1, #l3.1.
2011-06-09 01:15:49 +08:00
Steven Brown
b9c161f1f5 web: include all files in the diffstat
The webutil.diffstat function now returns a diffstat template for each file
in the diff. It previously returned a template for each file returned by
ctx.files() which did not work well for merge changesets.
2011-06-09 01:14:22 +08:00
LUO Zheng
04c821e46b bookmarks: recognize the current bookmark when the local encoding isn't UTF-8
The current bookmark is stored in bookmark.current, supposingly in UTF-8.
But the call to encoding.fromlocal() is missing, therefore Hg is not able
to recognize the current bookmark in the case that bookmark uses
characters of which the bit stream is different between local encoding
and UTF-8.
For example, the Chinese version of Windows cmd uses gbk(cp936), not UTF-8.
Therefore I won't be able to make a Chinese bookmark current.

By wrapping mark in a encoding.fromlocal() call, the problem is solved.
2011-06-08 21:25:18 +08:00
Adrian Buehlmann
0ec050dc6d revert: is reverting file states, not just file contents
e.g. x bit is reverted as well

Also makes this paragraph more consistent with the preceding one,
which already uses the term "state" (not "content").
2011-06-09 18:39:14 +02:00
Matt Mackall
efecb99535 hg: change various repository() users to use peer() where appropriate
This gets all the easy cases (peers that aren't also used as repositories).
2011-06-10 11:43:38 -05:00
Matt Mackall
d049d4f6ce hg: have peer() call _lookup directly
Note that this means that peers no longer call the extension
repository setup hooks.
2011-06-10 11:43:38 -05:00
Matt Mackall
5f2e38a0df hg: add peer method 2011-06-10 11:43:38 -05:00
Peter Arrenbrecht
d836ee3cea hg: add opts argument to clone for internal remoteui 2011-06-08 18:24:33 +02:00
Peter Arrenbrecht
66eeabddd2 hg: use capable instead of capabilities 2011-06-06 21:18:35 +02:00
Matt Mackall
5f5a2076a9 fileset: basic pattern and boolean support
debugfileset can now generate file lists for things like:

"* and not hg*"
2011-06-08 13:44:41 -05:00
Matt Mackall
1b52b02896 check-code: catch misspellings of descendant
This word is fairly common in Mercurial, and easy to misspell.
2011-06-07 17:02:54 -05:00
Matt Mackall
2717156b4a revert: drop obvious paragraph about filenames 2011-06-07 16:02:51 -05:00
Matt Mackall
230c790ec3 revert: actually add pointer to backout 2011-06-07 16:01:38 -05:00
Matt Mackall
3274575aec revert: replace mention of 'roll back' with pointer to 'backout' 2011-06-07 14:54:17 -05:00
Matt Mackall
679521be35 revert: simplify description of effect of -r 2011-06-07 14:51:18 -05:00
Matt Mackall
2e7368918f revert: rearrange the date help 2011-06-07 14:49:04 -05:00
Matt Mackall
e39fc72fef revert: remove some redundancy in basic description 2011-06-07 14:47:54 -05:00
Matt Mackall
40ee99d81f revert: drop requirement to use -r to revert with two parents
This reduces documentation confusion between the need to:

a) hg revert -a -r .  (drop all changes from a merge)
b) hg up -C .         (drop the second parent entirely)

Currently revert is one of two commands (the other being tag) that
still complains about uncommitted merges, dating from its former use
of a generic defaultrev function that aborted.
2011-06-07 14:19:05 -05:00
Matt Mackall
201910f74e revert: simplify usage note
This points people looking for other commands to the right place with
a minimum of verbiage.
2011-06-07 14:18:39 -05:00
Matt Mackall
310bb08a92 revert: rewrite help summary
New users have a tendency to mistake 'revert' as the command to use to
check out old revisions. They also occasionally mistake revert for a
generalized undo (compare rollback).

This version intentionally aims to avoid mentioning 'earlier' and thus
intentionally no longer alludes to the (secondary) -r behavior (which
in fact is not actually limited to 'earlier').

Instead, we mention checkout state, to convey that we can
restore things to the way they were when checked out.
2011-06-06 17:38:32 -05:00
Yuya Nishihara
5c2b085d52 extensions: make disabled()/disabledext() load prebuilt index if available
__index__ contains a dict of {name: desc} of all extensions.
2011-06-04 20:19:30 +09:00
Peter Arrenbrecht
67e220a8d7 sshrepo: fix addchangegroup's signature
Make it mirror the usage found in localrepo.push. This should only
affect pushes to pre-unbundle ssh servers.
2011-06-06 21:02:48 +02:00
Matt Mackall
c347d649b8 subrepo: be more careful with deletions of .hgsub and .hgsubstate (issue2844)
We shouldn't try to process subrepos if .hgsub isn't present and we
should remove .hgsubstate if .hgsub is marked for removal.
2011-06-06 15:17:40 -05:00
Patrick Mezard
7acb34dda5 patch: dot not ignore hunk of files marked as 'deleted'
git 'deleted' flag was processed unconditionnally and the file removed even if
the related hunk was not matching.
2011-06-05 22:26:01 +02:00
Patrick Mezard
f3d2dd1ca2 patch: fix patchmeta/hunk synchronization in iterhunks()
Synchronizing on bfile does not work on file removal where bfile is /dev/null.
We match items on afile or bfile instead. The incorrect code makes iterhunks()
to emit patchmeta and hunks separately in some cases. This is currently hidden
by applydiff() being too tolerant when processing patchmeta, and will be fixed
later.
2011-06-05 22:24:19 +02:00
Patrick Mezard
fc7fde3949 patch: remove unnecessary exists() call in selectfile() 2011-06-05 22:24:11 +02:00
Patrick Mezard
6ea3f75e49 import: deprecate --base
This option was a convenient hack introduced in Mercurial early days which
unfortunately survived until now.
2011-06-05 22:24:02 +02:00
Patrick Mezard
62588fedca patch: remove redundant islink() call 2011-06-05 13:27:06 +02:00
Yuya Nishihara
e900ecac29 extensions: update doc of enabled() and disabled() according to 96b1098c07ee 2011-06-04 20:01:01 +09:00
Patrick Mezard
f99a853422 localrepo: add savecommitmessage() to write last-message.txt 2011-06-04 15:56:48 +02:00
Patrick Mezard
97b28ace29 memctx: simplify constructor 2011-06-04 15:20:49 +02:00
Matt Mackall
86143efd7d scmutil: improve path calculation for install-relative RC files (issue2841)
This code was ugly and might do the wrong thing with symlinks.
2011-06-03 15:08:08 -05:00
Adrian Buehlmann
ff008eb648 prepush: show details about new remote heads with --verbose
previously, this info was only shown with --debug

Note that the new remote heads are only shown if the command aborts,
that is, they are *not* shown if --force was specified.

See also change 914ebeb62db8.
2011-06-03 13:10:22 +02:00
Adrian Buehlmann
1c143846c7 prepush: print short hash of first new head in abort message
and don't mention the branch if it's the default branch.

OLD:

  $ hg push ../a
  pushing to ../a
  searching for changes
  abort: push creates new remote heads on branch 'default'!
  (you should pull and merge or use push -f to force)

NEW:

  $ hg push ../a
  pushing to ../a
  searching for changes
  abort: push creates new remote head 1e108cc5548c!
  (you should pull and merge or use push -f to force)

This helps to identify which local head is causing troubles.

See also change 914ebeb62db8.
2011-06-03 12:16:17 +02:00
Adrian Buehlmann
a879df5001 prepush: eliminate 'if branch'
branch is always set anyway

No change in program behavior.
2011-06-03 11:26:43 +02:00
Sune Foldager
7db447dd4c revlog: bail out earlier in group when we have no chunks 2011-06-03 20:32:54 +02:00
Sune Foldager
5d8acb706f localrepo: simplify file bundling code and fix progress bug
Progress for files was off by one, and the code was rather hackish.
2011-06-03 20:23:32 +02:00
Sune Foldager
307e81bf40 localrepo: use list comprehension instead of generators
The lists in question are iterated and kept in memory further down the code
path anyway, and this simplifies things.
2011-06-03 20:15:06 +02:00
Sune Foldager
e4e3ee35de localrepo: add total to changeset progress in bundle/push 2011-06-03 20:12:37 +02:00
Martin Geisler
94d9d879d7 statichttprepo: use in-place difference for shorter line 2011-06-03 20:08:26 +02:00
Adrian Buehlmann
7062c2db6e workingctx: eliminate remove function
Inlining it into it's last remaining call place in cmdutil.copy.

Note that cmdutil.copy is called with the wlock already held, so no additional
locking is needed to call util.unlinkpath.

We do not need to wrap the util.unlinkpath call into a try block, because
at that point we already know whether abssrc exists or not -- thanks to the
preceding util.copyfile call. Adding a new local 'srcexists' in cmdutil.copy
for that purpose.
2011-06-02 00:33:33 +02:00
Idan Kamara
02f21a70dc util: add helper function isatty(fd) to check for tty-ness 2011-06-02 00:43:34 +03:00
Steven Brown
ef568e7358 web: prevent TypeError thrown when using the diffstat templates
Remove the lambda used to wrap webutil.diffstat because:
- functions passed to the templater must accept keyword arguments
- webutil.diffstat is a generator, so already calculates the diffstat lazily

This reverts the changes made to a4067e29e29d after it was submitted to the
mailing list but before it was queued.
2011-06-02 18:52:31 +08:00
Matt Mackall
6bf6135996 fileset: fix long line 2011-06-02 11:27:40 -05:00
Matt Mackall
fd0ca6b6e5 filesets: introduce basic fileset expression parser 2011-06-01 19:12:18 -05:00
Idan Kamara
a910ab36b8 dispatch: add repo to the request
allows callers of dispatch.dispatch to pass in
an initialized repo object to be used.

-R/--repository overrides the request repo.
2011-06-02 00:43:34 +03:00
Martin Geisler
af8a35e078 check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +02:00
Augie Fackler
2578f4f9f2 subrepo: make stdin for svn a pipe for non-interactive use (issue2759)
This certainly can't hurt, so go ahead and do it, potentially along
with --non-interactive if that flag is safe for the given subcommand.
2011-05-31 19:49:17 -05:00
Steven Brown
a8c12e93a7 web: provide diffstat to the changeset page
This includes all affected files, so it can be used for an extended view of
the files or as a replacement for the filenodelink and filenolink templates.
2011-05-28 14:44:45 +08:00
Regis Desgroppes
422cfa6bde subrepo: svn abort now depends on exit code (issue2833) 2011-05-31 16:22:04 -05:00
Matt Mackall
ebb03b5a77 config: ignore include errors for nonexistent files 2011-05-31 16:00:39 -05:00
Brendan Cully
ea84333a75 Make pull -u behave like pull && update
Previously, pull would not update if new branch heads were received,
whereas pull && update would move to the tipmost branch head.

Also change the "crosses branches" abort in merge.update from
"crosses branches (merge branches or use --check to force update)"
to
"crosses branches (merge branches or update --check to force update)"

since it can no longer assume the user is running hg update.
2011-05-31 11:52:22 -07:00
Matt Mackall
b0048281b5 requires: note apparent corruption 2011-05-31 15:55:23 -05:00
Adrian Buehlmann
cfc4484960 readrequires: provide easier to understand error message
NEW:

  $ hg id
  abort: unknown repository format: requires feature 'foo' (upgrade Mercurial)!

OLD:

  $ hg id
  abort: requirement 'foo' not supported!
2011-05-31 19:16:25 +02:00
Adrian Buehlmann
924c56c606 introduce new function scmutil.readrequires
for reading and parsing the .hg/requires file
2011-05-31 19:16:18 +02:00
Matt Mackall
e5b463de99 merge with stable 2011-05-31 15:28:23 -05:00
Eric Eisner
55bac452e8 subrepo: don't crash when git .hgsubstate is empty (issue2716) 2011-05-28 11:03:48 -04:00
Adrian Buehlmann
a216345ef2 workingctx.remove: use self.forget 2011-05-27 21:11:44 +02:00
Martin Geisler
e495964784 commands: use repo.branchheads in heads command 2011-05-31 13:18:56 +02:00
Martin Geisler
f365370231 commands: remove unused variable from heads command
The b variable has not been needed since 5333bad7a76b. Renamed ls
variable to bheads for clarity.
2011-05-31 09:59:03 +02:00
Martin Geisler
4cb518e9a1 hg: remove underscores in clone function 2011-05-27 12:42:36 +02:00
Martin Geisler
5cdd89938e doc: improve merge between hgrc.5 and config help topic 2011-05-30 11:15:25 +02:00
Martin Geisler
7cbe536a61 help/config: separate terms with a blank line
This makes it easier for translators since they can then translate
each term individually.
2011-05-30 10:35:43 +02:00
Martin Geisler
a66b0892f8 help/config: fix rendering of definition list
Without the blank line, the minirst parser renders

  Term-1
    Line-1

    Line-2
  Term-2
    Line-1

as

  Term-1
    Line-1

  Line-2 Term-2 Line-1

because the second term is seen as a paragraph.
2011-05-30 10:30:46 +02:00
Yun Lee
657bb2225f help: move part of hgrc.5 man page config help topic 2011-05-30 10:21:39 +02:00
Patrick Mezard
ab82a700d3 patch: do not patch unknown files (issue752) 2011-05-27 21:50:11 +02:00
Patrick Mezard
d4b7db6294 patch: use temporary files to handle intermediate copies
git patches may require copies to be handled out-of-order. For instance, take
the following sequence:

  * modify a
  * copy a into b

Here, we have to generate b from a before its modification. To do so,
applydiff() was scanning for copy metadata and performing the copies before
processing the other changes in-order. While smart and efficient, this approach
complicates things by handling file copies and file creations at different
places and times. While a new file must not exist before being patched a copied
file already exists before applying the first hunk.

Instead of copying the files at their final destination before patching, we
store them in a temporary file location and retrieve them when patching. The
filestore always stores file content in real files but nothing prevents adding
a cache layer. The filestore class was kept separate from fsbackend for at
least two reasons:

- This class is likely to be reused as a temporary result store for a future
  repository patching call (entries just have to be extended to contain copy
  sources).

- Delegating this role to backends might be more efficient in a repository
  backend case: the source files are already available in the repository itself
  and do not need to be copied again. It also means that third-parties backend
  would have to implement two other methods. If we ever decide to merge the
  filestore feature into backend, a minimalistic approach would be to compose
  with filestore directly. Keep in mind this copy overhead only applies for
  copy/rename sources, and may even be reduced to copy sources which have to
  handled ahead of time.
2011-05-27 21:50:10 +02:00
Patrick Mezard
e6f284be06 patch: refactor file creation/removal detection
The patcher has to know if a file is being created or removed to check if the
target already exists, or to actually unlink the file when a hunk emptying it
is applied. This was done by embedding the creation/removal information in the
first (and only) hunk attached to the file.

There are two problems with this approach:

- creation/removal is really a property of the file being patched and not its
  hunk.

- for regular patches, file creation cannot be deduced at parsing time: there
  are case where the *stripped* file paths must be compared. Modifying hunks
  after their creation is clumsy and prevent further refactorings related to
  copies handling.

Instead, we delegate this job to selectfile() which has all the relevant
information, and remove the hunk createfile() and rmfile() methods.
2011-05-27 21:50:09 +02:00
Adrian Buehlmann
5e0e57cb94 commands.remove: don't use workingctx.remove(list, unlink=True)
workingctx.remove(list, unlink=True) is unsuited here, because it does too
much: it also unlinks added files. But the command 'hg remove' is specified
to *never* unlink added files.

Instead, we now unlink the files at the commands.remove level (if --after was
not specified) and use workingctx.forget for all files.

As an added bonus, this happens to eliminate a wlock acquire/release pair,
since the previous implementation caused

   acquire wlock
   release wlock
   acquire wlock
   release wlock

where the first pair of acquire/release was caused by the workingctx.forget
call, and the second by the workingctx.remove call.
2011-05-27 15:59:52 +02:00
Matt Mackall
fd5cc95a4a coal: use preformatted text for descriptions (issue2835)
The coal style was broken here by an earlier change to paper, which
shares files.
2011-05-27 08:50:27 -05:00
Martin Geisler
2edabc4530 subrepo: refactor writestate for clarity 2011-05-27 11:01:44 +02:00
Matt Mackall
5f2364be24 cmdutil: make private copies of option lists to avoid sharing monkeypatches 2011-05-26 17:15:35 -05:00
Paul Molodowitch
dfc345d9b5 subrepo: bare git repos considered dirty
Currently, if there is a bare git subrepo, but it is at the "right"
revision, calling dirty() will error because diff-index does not work
on bare repos. This patch makes it so bare subrepos are always
considered dirty.
2011-05-25 08:38:58 -07:00
Idan Kamara
b9dc5b5bf7 dispatch: use the request to store the ui object
and check if we got one before creating.

note that the contents of the ui object might change after
dispatch() returns (by options passed through --config for example),
to ensure it doesn't, pass a copy() of it.
2011-05-26 00:53:23 +03:00
Idan Kamara
5544ef8f07 dispatch: wrap dispatch related information in a request class
currently only stores the arguments.
2011-05-26 00:44:11 +03:00
Steven Brown
b13eee65a4 patch: restore the previous output of 'diff --stat'
Restore the previous diffstat behaviour of scaling by the maximum number of
changes to a single file. Changeset 7bb0e22a7988 modified the diffstat to be
scaled by the total number of changes. This seems to have been unintentional.
2011-05-26 22:51:02 +08:00
Peter Arrenbrecht
8761d1fa87 wireproto: enable optional args for known() for future extensibility
Firstly, I think we should do this for all new wire commands, just
to be on the safe side. So I want to get this into the 1.9 release.

Secondly, there actually is potential here that sometimes the server
can know that the number of its nodes which can possibly still be
undecided on the client is small. It might then just send them along
directly (cutting short the end game). This, however, requires
walking the graph on the server, which can be expensive, so for the
moment we're not actually doing it.
2011-05-24 17:48:16 +02:00
Matt Mackall
c6e850b04b context: make forget work like commands.forget
Switch users of wctx.delete(..., False) to forget.
2011-05-26 17:15:35 -05:00
Matt Mackall
97c6e7b48d dirstate: rename forget to drop
It has substantially different semantics from forget at the command
layer, so change it to avoid confusion.

We can't simply combine it with remove because we need to explicitly
drop non-added files in some cases like commit.
2011-05-26 17:15:35 -05:00
Martin Geisler
ce8ced9777 minirst: read test input from stdin 2011-05-26 10:46:34 +02:00
Matt Mackall
a8dec32fed httprepo: handle large lengths by bypassing the len() operator 2011-05-24 17:30:00 -05:00
Adrian Buehlmann
5872a76fa2 workingctx.remove: don't stat files again after unlinking
we already know at this point that they have been unlinked
2011-05-24 14:52:23 +02:00
Matt Mackall
438f823709 httprepo: send URL redirection notices to stderr (issue2828) 2011-05-24 17:16:31 -05:00
Augie Fackler
14a08e5514 pure parsers: properly detect corrupt index files
This new Python code should be equivalent in behavior to the if
statement at line 312 of parsers.c. Without this, the pure-python
parsers improperly ignore truncated revlogs as created in
test-verify.t.
2011-05-24 13:30:10 -05:00
Adrian Buehlmann
2fa6cdd315 workingctx: unlink paths while holding the wlock 2011-05-24 14:08:20 +02:00
Martin Geisler
34dddcd6fe wireproto: do not hash when heads == ['force']
Changeset 20b319765bcf introduced the unbundlehash capability and
unconditionally hashed the heads on the client side. By mistake, the
heads were also cased in the heads == ['force'] case.
2011-05-24 16:12:01 +02:00
Patrick Mezard
32250cd067 patch: remove EOL support from linereader class
This was only used when reading patched files which is now done by backends.
2011-05-24 14:21:04 +02:00
Matt Mackall
db4e14bfa3 subrepo: handle local added subrepo case correctly 2011-05-23 22:49:10 -05:00
Idan Kamara
d5c206ffa2 extensions: raise when trying to find an extension that failed to load
extensions that depend on other extensions (such as record) use this pattern
to check if the dependant extension is available:

    try:
        mq = extensions.find('mq')
    except KeyError:
        return

but since if an error occurs while loading an extension it leaves its entry
in the _extensions map as None, we want to raise in that situation too.

(rather than adding another check if the return value is None)
2011-05-23 23:09:00 +03:00
Adrian Buehlmann
f559c2bcbb remove: clarify help text about added files never being deleted from disk 2011-05-23 15:56:31 +02:00
Martin Geisler
ff9aae8a76 changelog: convert user and desc from local encoding early
Failing to do so makes it impossible to use the memctx API to create a
changeset with a commit message or username outside of the current
encoding.encoding setting.
2011-05-19 18:09:25 +02:00
Martin Geisler
3eec57aed2 subrepo: respect non-default path for incoming/outgoing
Push and pull set repo._subtoppath before pushing or pulling subrepos.
The incoming and outgoing commands needed to do the same.
2011-05-18 15:13:26 +02:00