Commit Graph

8035 Commits

Author SHA1 Message Date
Idan Kamara
550bca7579 cmdserver: restore old working dir after dispatch when we have --cwd 2011-07-11 17:49:45 +03:00
Idan Kamara
27bbf9363c dispatch: don't use request repo if we have --cwd 2011-07-11 17:46:55 +03:00
Steve Borho
bb2fdf8f33 scmutil: add missing import of re
see https://bitbucket.org/tortoisehg/thg/issue/929
2011-07-08 20:24:19 -05:00
Matt Mackall
47766aa6d3 revsets: actually catch type error on tip^p1(tip) (issue2884)
The previous commit was empty.
2011-07-12 12:35:03 -05:00
Martin Geisler
d1589aefcc commands: improve help for -y/--noninteractive
Before, the help text said that Mercurial would assume 'yes' for all
prompts, but this is confusing since many prompts don't have any 'yes'
choice. It now more accurately describes what will happen.
2011-07-07 10:32:30 +02:00
Matt Mackall
73b047e45e revsets: do the right thing with x^:y (issue2884)
Given an operator ^ that's either postfix or infix and an operator :
that's either prefix or infix, the parser can't figure out the right
thing to do. So we rewrite the expression to be sensible in the optimizer.
2011-07-06 13:37:50 -05:00
Matt Mackall
b06b887ee8 discovery: quiet note about heads
This was changing output on in/out -v for no good reason.
2011-07-05 14:30:42 -05:00
Wagner Bruna
56657ac28b patch: fix parsing patch files containing CRs not followed by LFs
Since 75e6e3c16f9c , patch lines containing a CR not followed by a LF
would be incorrectly splitten, causing a failure to apply the patch.
2011-07-04 19:53:39 -03:00
Idan Kamara
9401c4603c fileset: fix typo in binary() doc 2011-07-04 14:36:16 +03:00
Arne Babenhauserheide
81729d0d3f help: fileset foo.lst was named files.lst 2011-07-01 22:50:36 +02:00
Mads Kiilerich
e8138203dd util: rename the util.localpath that uses url to urllocalpath (issue2875)
util is never imported by any other name than util, so this is mostly just a
simple search and replace from util.localpath to util.urllocalpath (assuming
other uses of util.localpath already has been renamed).
2011-07-01 17:37:09 +02:00
Eli Carter
8827c54a9a subrepo: correct revision in svn checkout
A Subversion subrepo checkout uses a url and --revision which does not do the
correct thing when specifying a revision of a branch that has since been
deleted and recreated.  The checkout needs to specify the revision as URL@REV
instead.
2011-06-30 13:22:12 -05:00
Matt Mackall
b80e3885ef merge with i18n 2011-06-29 16:05:41 -05:00
Jesse Long
33d5742949 hgweb: treat branch attribute closed' as more important than inactive'
In the branches page, branches that are closed and are merged into another
branch are displayed as `inactive'. This patch changes that behaviour to
show these branches as `closed'.

For me, the `closed' attribute is more important than the `inactive'
attribute.

Branches that are not closed, and are merged into other branches will still
be shown as `inactive'.

Branches that are closed, and are not merged into other branches will still
be shown as `closed'.
2011-06-29 09:36:45 +02:00
Matt Mackall
8e3367eb55 subrepos: be smarter about what's an absolute path (issue2808) 2011-06-29 16:01:06 -05:00
Thomas Arendsen Hein
692a53d202 classes: fix class style problems found by 06e968819ac9
This makes test-wireprotocol.py work on Python 2.4
2011-06-29 15:00:00 +02:00
Martin Geisler
9c81f22e34 i18n: merge with main 2011-06-28 09:42:45 +02:00
Martin Geisler
5fd7504972 i18n: merge with main
This includes four i18n changesets transplanted from the default
branch to the stable branch since they were made after the freeze.
2011-06-27 19:10:45 +02:00
Wagner Bruna
a57ec020c9 localrepo: mark progress step for translation 2011-06-26 15:47:39 -03:00
Adrian Buehlmann
9b3812c8c6 revert: improve hints on abort when reverting to parent without --all
BEFORE:

    $ hg revert
    abort: no files or directories specified
    (use --all to discard all changes)

AFTER:

  Uncommitted changes (using --all *will* nuke edits):

    $ hg revert
    abort: no files or directories specified
    (uncommitted changes, use --all to discard all changes)

  Clean working directory (using --all won't discard anything):

    $ hg revert
    abort: no files or directories specified
    (use --all to revert all files)
2011-06-26 01:13:30 +02:00
Pierre-Yves David
2ebc0660c3 requirements: show all missing features in the error message.
Displaying all missing featureis help people to solve the issue (choosing the
right version, creation the right repo)
2011-06-25 02:30:24 +02:00
Pierre-Yves David
f95a6cfc12 error: Add a hint argument to RepoError
This use the same mechanism than Abort. Except clause stay distinct
because RepoError add "!" at the end of the message.
2011-06-25 02:30:17 +02:00
Idan Kamara
a1bff0c5fe dispatch: set config options on the request repo.ui 2011-06-24 19:44:59 +03:00
Idan Kamara
f0f55bda59 dispatch: return read config options 2011-06-24 19:44:59 +03:00
Idan Kamara
122edf3c57 dispatch: set global options on the request repo.ui
If the request has a repo, and global options such as --verbose are passed,
we need to set those explicitly on the repo.ui.
2011-06-24 19:44:58 +03:00
Idan Kamara
b66cd482a9 cmdserver: assign repo.baseui before running commands
There are places in the code that use localrepository.baseui (see hg.remoteui),
we need the ui descriptors (and possibly other things) to be set
correctly on it, so output written to the remoteui descriptors ends up at the
right place.

Before this change, tests such as 'test-bookmarks-pushpull.t' didn't work.
2011-06-24 19:44:17 +03:00
Idan Kamara
29b1c451dc cmdserver: copy repo.ui before running commands 2011-06-24 19:43:59 +03:00
Idan Kamara
c368cbab93 dispatch: set descriptors on the request repo.ui 2011-06-24 19:38:28 +03:00
Idan Kamara
22edb918b3 dispatch: pass the correct ui to runcommand
For commands that take a repo, repo.ui is passed as the ui to runcommand.
This restores that behaviour when the request has a repo.
2011-06-24 19:36:44 +03:00
Idan Kamara
446fde5f1b filemerge: use ui out descriptor when calling util.system 2011-06-24 17:04:37 +03:00
Idan Kamara
05ff7deb85 archive: wrap the ui descriptor so it doesn't get closed
archival.tarit closes the fileobj if one is passed to it, which is undesired
when reading from '-'.
2011-06-24 17:04:37 +03:00
Idan Kamara
eb3fbf796f bisect: use ui out descriptor when calling util.system 2011-06-24 17:04:37 +03:00
Idan Kamara
fce499faf1 ui: use ui out descriptor when calling util.system 2011-06-24 17:04:37 +03:00
David Golub
3605e62f7c call reposetup for repositories returned from peer (issue2864)
Extension setup functions were not being called when repositories were
obtained using the peer function instead of the repository function.
2011-06-24 11:39:12 -04:00
Idan Kamara
ff97debbbd dispatch: make sure unspecified global ui options don't override old values 2011-06-24 12:16:14 +03:00
Adrian Buehlmann
3ae6b61c82 update: do not use the term 'update' when mentioning reverting one file
and give a more precise hint for how to revert such a file

I'm using the term 'revision' instead of 'changeset' in this change to be
consistent with the REV we use in the synopsis.
2011-06-24 10:31:44 +02:00
Idan Kamara
f916e19611 cmdserver: fix read-loop string concatenation 2011-06-24 16:36:24 +03:00
Idan Kamara
848255e076 dispatch: check for None before closing repo
We were trying to call close() if repo == None and req.repo != None.
This can happen when running commands that don't take a repo.
2011-06-24 16:30:43 +03:00
Adrian Buehlmann
1d541dffa3 revert: mention update in hint of abort when reverting to non-parent
and explicitly warn about uncommitted changes

Examples:

BEFORE:

    $ hg par -q
    7:e81a2efd53d4
    $ hg revert -r 2
    abort: no files or directories specified
    (use --all to discard all changes)

AFTER:

  Clean working directory (revert can be easily undone, no edits to be lost):

    $ hg revert -r 2
    abort: no files or directories specified
    (use --all to revert all files, or 'hg update 2' to update)

  Uncommitted changes (revert --all *does* discard edits and is pretty hard to
  undo or even impossible if --no-backup is specified):

    $ hg revert -r 2
    abort: no files or directories specified
    (uncommitted changes, use --all to discard all changes, or 'hg update 2' to update)
2011-06-24 12:37:29 +02:00
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