Commit Graph

1947 Commits

Author SHA1 Message Date
Brodie Rao
20c102ca36 grep: only catch re.error when compiling regular expressions 2010-09-22 19:15:27 -05:00
Mads Kiilerich
82136a3aba merge with stable 2010-09-23 01:59:02 +02:00
Mads Kiilerich
48773bdeed log: include unmodified-in-merge files in log diff/stat (issue2383)
f02da4369319 assumed that walkchangerevs called prep with all relevant matched
filenames, but actually it only contains the names of files changed in the
relevant changeset. That meant that log diff/stat of merges missed the diff for
files only changed in the other branch.

This is a minimal fix for making sure we only use fns when we are following and
thus will have problems with merges anyway ...
2010-09-23 01:23:16 +02:00
Peter Arrenbrecht
c3d38bfaec merge: delay writing the mergestate during until commit is called
This speeds up merges of lots of files considerably.
2010-09-06 17:35:49 +02:00
Martin Geisler
34af0cf109 subrepo: add support for 'hg archive' 2010-09-20 15:46:17 +02:00
Martin Geisler
d37ba034d5 incoming: recurse into subrepositories with --subrepos/-S flag
As with push and outgoing, the optional source path is ignored for the
subrepositories. Fixing this is Issue1852.
2010-09-13 13:09:31 +02:00
Martin Geisler
e849a4fa16 incoming: move code from commands to cmdutil
This makes it easier to reuse it in a recursive fashion for subrepos.
2010-09-13 13:09:30 +02:00
Martin Geisler
2346ea8e9e outgoing: recurse into subrepositories with --subrepos/-S flag
As with push, the optional destination path is ignored for the
subrepositories, i.e., they are always compared with their default
push path. Fixing this is Issue1852.
2010-09-13 13:09:26 +02:00
Martin Geisler
d191f04663 outgoing: move code from commands to cmdutil
This makes it easier to reuse it in a recursive fashion for subrepos.
2010-09-13 13:09:24 +02:00
Martin Geisler
cb93a10b9b add: recurse into subrepositories with --subrepos/-S flag 2010-09-13 13:09:20 +02:00
Martin Geisler
186cdcc54b add: move main part to cmdutil to make it easier to reuse 2010-09-13 13:09:11 +02:00
Martin Geisler
112ea7d5ed patch: break import cycle with cmdutil
The patch module imported cmdutil but used it only in updatedir.
2010-09-13 13:08:09 +02:00
Dirkjan Ochtman
fcf4736e92 check-code: fix ternary expression introduced in edd0d998158f 2010-09-08 15:16:03 +02:00
Dirkjan Ochtman
7846080481 bisect: warn about ending on a merge with only one side marked 2010-09-08 13:48:25 +02:00
Dirkjan Ochtman
fe46f658e0 bisect: allow revsets in addition to single revs (issue2360) 2010-09-08 12:53:15 +02:00
Martin Geisler
b34e1ad2c0 add: clarify that repo[None].add returns rejected filenames 2010-09-07 10:30:29 +02:00
Martin Geisler
e9c2a20771 diff: recurse into subrepositories with --subrepos/-S flag 2010-09-03 12:58:51 +02:00
Martin Geisler
f2188b5b90 status: recurse into subrepositories with --subrepos/-S flag 2010-09-03 12:58:51 +02:00
Brodie Rao
16ed03215d remove: properly set return code when warnings are issued
This removes the warn() function in favor of issuing warnings directly
for each kind of file that Mercurial won't remove.

This also uses three separate translatable strings instead of using
string formatting to build the message. This should make it easier to
localize.
2010-08-30 20:27:25 -04:00
Martin Geisler
756848e3f7 pull: lowercase error message 2010-09-01 12:05:57 +02:00
Sune Foldager
71bfee650b debugindex(dot): try to access filelogs through repo, if possible
If a repository is accesible, first treat the filename as a working copy file
and try to open its filelog. Fallback to opening the file directly as a
revlog, as before.
2010-09-01 15:03:45 +02:00
Sune Foldager
0a9170f5e6 debugdata: try to access filelogs through repo, if possible
If a repository is accesible, first treat the filename as a working copy file
and try to open its filelog. Fallback to opening the file directly as a
revlog, as before.
2010-09-01 14:55:03 +02:00
Martin Geisler
516e74e526 merge with stable 2010-09-01 12:28:34 +02:00
Brodie Rao
5a1e1994ac help: refer to user configuration file more consistently
Currently, a number of commands and help topics mention the user hgrc
file in different ways. Among these are following:

1. .hgrc - "please specify your commit editor/username in your .hgrc
file", bookmarks, color, hgk, pager, hg help environment

2. $HOME/.hgrc - hg help paths, hgrc(5), hg(1)

3. ~/.hgrc - hgrc(5)

In addition to being inconsistent, none of these make sense on
Windows. This patch replaces the above with a more general term of
"[your] configuration file".
2010-08-27 22:36:35 -04:00
Martin Geisler
5f46f16fb7 Lowercase error messages 2010-08-29 22:37:58 +02:00
Martin Geisler
c3c7fa090f Merge with stable 2010-08-30 13:00:22 +02:00
Brodie Rao
d1905b7d87 mail/hgweb: support service names for ports (issue2350)
This adds util.getport(port) which tries to parse port as an int, and
failing that, looks it up using socket.getservbyname(). Thus, the
following will work:

    [smtp]
    port = submission

    [web]
    port = http

This does not apply to ports in URLs used in clone, pull, etc.
2010-08-28 12:31:07 -04:00
Martin Geisler
cb36142754 Merge with stable 2010-08-29 22:55:37 +02:00
Brodie Rao
0f9d940cb9 cleanup: remove unused variables 2010-08-27 13:32:40 -04:00
Martin Geisler
2f9eb9bd07 revert: wrap long line 2010-08-25 16:40:49 +02:00
Martin Geisler
bfea979db3 util: remove lexists, Python 2.4 introduced os.path.lexists 2010-08-25 16:23:32 +02:00
Matt Mackall
fa11c5cbae debuginstall: report installpath 2010-08-20 15:31:05 -05:00
Jeremy Whitlock
0a6d3a397f color: enable branches support
This commit updates the branches command to use ui.label for the branch names
and the changeset.  This implementation allows assigning colors to the four
states of a branch: active, closed, current and inactive.  While you can
configure color for the four states, only current and closed have default colors
of green and black bold respectively.
2010-07-28 23:05:03 -06:00
Xavier Snelgrove
edea98c84f revert: use opts.get
If you want to programatically perform a revert right now you need to
include a date=False parameter due to the use of opt["date"] instead
of opt.get("date").
2010-08-13 13:59:26 -04:00
Martin Geisler
ec0bf03276 Merge with stable 2010-08-15 18:13:46 +02:00
Martin Geisler
90ff407862 debugbuilddag: escape backslash properly in help string 2010-08-15 17:33:03 +02:00
Greg Ward
b38d220736 commit: explicitly document the existence of "last-message.txt" 2010-08-14 14:57:33 +02:00
Martin Geisler
fb68103f19 Merge with stable 2010-08-13 10:28:59 +02:00
Mark Edgington
f3ee05373b resolve: updated help documentation for improved clarity 2010-08-12 22:48:22 +02:00
Martin Geisler
c3f9a46ceb Merge with stable 2010-08-11 12:30:18 +02:00
Martin Geisler
eeae22999b commands: use round parenthesis in 'hg head --active' help
This is the style used in the rest of the help strings.
2010-08-11 12:21:27 +02:00
Matt Mackall
9cc346f0b4 help: fix bytes/digit confusion for hashes
spotted by FUJIWARA Katsunori <fujiwara@ascade.co.jp>
2010-07-31 18:27:03 -05:00
Matt Mackall
272a0b3fc3 Merge with stable 2010-07-27 16:04:00 -05:00
Benjamin Pollack
728f9bcc7e tag: do not allow tag names to consist solely of whitespace (issue2307)
(simplification and test by mpm)
2010-07-27 14:40:25 -04:00
Patrick Mezard
14211b6209 debugbuilddag: build repository content in binary mode 2010-07-26 23:26:15 +02:00
Nicolas Dumazet
7a95a27065 bundle: lookup revisions after addbranchrevs
When addbranchrevs extends revs, it adds changeset hashes, and not node ids.
Which means that we have to lookup for revisions _after_ the addbranchrevs
call, instead of before.
2010-07-20 18:29:00 +09:00
Mads Kiilerich
b098dc8c48 revert: rename original to .orig instead of copying (issue2282)
By renaming before reverting the content of the file we ensure that we handle
and break hardlinks properly.

Handling of other hardlinks to .orig is somebody elses problem.
2010-07-13 03:04:14 +02:00
Steve Losh
aaac1bb52d commands: fix update's help to be more accurate
Branches can have multiple heads, so it doesn't make sense to speak of "the
head of the current branch". What update really does is try to update to the
*tip* of the current branch.
2010-07-14 18:28:12 -04:00
FUJIWARA Katsunori
2f9dbb12f7 i18n: use encoding.colwidth() for correct column width
Some encoding and language combinations (e.g.: UTF-8 and Japanese)
cause encoding characters into sequence of bytes more than column
width of them.

So, encoding.colwidth() should be applied instread of len() on i18n
strings.

In addition to it, formatting by '%*s'/'%-*s' also uses "number of
bytes" to calculate space padding size, and should be fixed, too.
2010-07-18 01:06:50 +09:00
Nicolas Dumazet
517eb64655 merge with stable 2010-07-22 15:14:22 +09:00
Matt Mackall
33994da433 Merge with stable 2010-07-20 15:07:10 -05:00
Martin Geisler
7f537e599c Merge with stable 2010-07-19 00:43:34 +02:00
Martin Geisler
138130c348 archival: move commands.archive.guess_type to archival.guesskind
The list of suffixes for each kind of archive belongs in archival.
Renamed function to fit with out code style.
2010-07-14 20:25:31 +02:00
Dirkjan Ochtman
e647af81b9 commands: addremove does similarity 100 by default 2010-07-13 17:30:29 +02:00
Martin Geisler
5fbbb27c25 Merge with stable 2010-07-09 14:21:45 +02:00
Arnab Bose
a9ac0e99d7 commands: mention "hg status -C" in addremove help 2010-07-09 13:31:37 +02:00
Steve Losh
c2cf2592b2 dispatch: add shell aliases
This patch adds git-style "shell aliases" to Mercurial.

Any alias with a definition beginning with a '!' will be treated as a shell
alias. For example:

    [alias]
    echo = !echo
    qempty = !hg qrefresh -X "`hg root`" ; echo Emptied patch "`hg qtop`"

    $ hg echo foo
    foo
    $ hg qempty
    Emptied patch foo
    $
2010-07-07 18:49:43 -04:00
Robert Bauck Hamar
d6a84c6ef2 commands: only warn when reopening the workdir's branch
When commiting, a check is made to see if one of the parents is a
closed head. However this did not check that the branch of the commit
is the same as the closed head, so one could get a warning message on
the sequence

  hg commit --close-branch
  hg branch new-branch
  hg commit

or when merging in a closed head.
2010-07-07 14:11:59 +02:00
Yuya Nishihara
910c40b6b6 log: fix missing diff output for hg log -p in sub directory
prep(ctx, fns) receives paths relative to repository root, not cwd.
2010-07-02 23:49:06 +09:00
Nicolas Dumazet
1624d50ea1 commands: document return values of add and paths commands 2010-07-04 17:05:17 +09:00
Mads Kiilerich
812bb21f4d log: follow filenames through renames (issue647)
In commands.log a displayer was initialized from
cmdutil.show_changeset() with the initial matchfn (which designates
the specified files which only is correct in the highest revision in
the range). prep() is handed the correct list of files, but
displayer.show() didn't use that list but keept using the original
matchfn.

The matchfn argument to cmdutil.show_changeset() wasn't specified in
other places and is only used in .show(), so now we give the matchfn
as an optional parameter to .show().

We do however still have to detect --patch and --stat from opts in
show_changeset() and let it imply a matchall, but that can now be
overruled with the new .show() matchfn parameter.
2010-06-29 12:12:34 +02:00
Mads Kiilerich
07f64c28d2 revert: Make it clearer when not to use revert 2010-06-28 15:08:01 +02:00
Matt Mackall
5c92f50408 merge: document how to 'undo' a merge 2010-06-27 17:41:43 -05:00
Matt Mackall
e4cf775b71 addchangegroup: pass in lock to release it before changegroup hook is called
Currently, callers of addchangegroup first acquire the repository
lock, usually to check that an unbundle request isn't racing. This
means that changegroup hook actions that might write to a repo get
stuck waiting for a lock. Here, we add a new optional lock parameter
and update all the callers. Post-1.6 we may make it non-optional.
2010-06-25 13:47:28 -05:00
Martin Geisler
547f89d8a5 commands: advertise "hg help revsets" in help for log 2010-06-18 21:35:21 +02:00
Matt Mackall
3902a6d8f6 pushkey: add debugpushkey command for testing 2010-06-16 16:05:47 -05:00
Greg Ward
20b557f443 merge: when current branch has 1 or > 2 heads, actually abort.
Currently merge just prints abort-like messages to stderr and then
exits with a misleading status 0 (cleverly disguised as "False").
With this change it raises Abort, just like every other fatal error.
2010-06-14 16:06:52 -04:00
Martin Geisler
e996783e84 commands: get rid of generic exception in debugbuilddag 2010-06-15 09:53:50 +02:00
Martin Geisler
96576cd383 commands: format is a Python2.6 function 2010-06-11 18:54:10 +02:00
Peter Arrenbrecht
b9ce7f49a5 debugbuilddag: build a changelog dag from a concise description
Useful in tests to quickly build a complex DAG in an empty repo.
Handles local tags and named branches.
Options to, at each rev,
 - create a new file,
 - overwrite the same file,
 - append to the same file,
 - write to a specific line in a mergeable file.
Can run shell commands during DAG buildup.
2010-06-10 11:49:48 +02:00
Peter Arrenbrecht
a9d00c7c41 debugdag and debugindexdag: emit changelog/revlog DAGs as concise text
Mainly useful for reusing DAGs somewhere else, for example for attaching
them to a bug report, or for importing them into other environments
(like my test environment for incoming/outgoing discovery).
2010-06-10 11:48:45 +02:00
Matt Mackall
1cf1295d6e summary: report copies and renames 2010-06-09 16:39:25 -05:00
FUJIWARA Katsunori
ce06b102df help: show value requirement and multiple occurrence of options
this helps users to know what kind of option is:

  - no value is required(flag option)
  - value is required
  - value is required, and multiple occurrences are allowed

each kinds are shown as below:

 -f --force              force push
 -e --ssh CMD            specify ssh command to use
 -b --branch BRANCH [+]  a specific branch you would like to push

if one or more 3rd type options are shown, explanation for '[+]' mark
is also shown as footnote.
2010-06-06 17:25:00 +09:00
Gilles Moris
54d30f05ab commit: fix display of 'created new head' message (issue2186)
To avoid recurrent fixes for the display of this message, a summary table with
all case combinations has been added to the code.
Basically, there is two condition for the message to be printed:
* this is not an initial (named branch or topo) root
* none of the parents are in the current branch heads
2010-06-08 22:28:42 +02:00
Steve Borho
0d0e614fc9 Merge backout 2010-06-08 15:52:56 -05:00
Steve Borho
b82bd4f289 Backed out changeset: 1bfde817782c 2010-06-08 15:52:41 -05:00
Dirkjan Ochtman
af6b696f0f move working dir/dirstate methods from localrepo to workingctx 2010-06-07 20:03:32 +02:00
Steve Borho
e91613380a color: labeled text should be passed to ui.write() as ui.labeled
Some implementations of ui.label() (HTML versions in particular) must escape
the provided text and then markup the text with their tags.  When this marked
up text is then passed to ui.write(), we must label the text as 'ui.labeled'
so the implementation knows not to escape it a second time (exposing the initial
markup).

This required the addition of a 'ui.plain' label for text that is purposefully
not marked up.

I was a little pedantic here, passing even ' ' strings to ui.label() when it
would be included with other labeled text in a ui.write() call.   But it seemed
appropriate to lean to the side of caution.
2010-06-03 23:18:18 -05:00
Dirkjan Ochtman
cf1de649bd move discovery methods from localrepo into new discovery module 2010-06-07 18:35:54 +02:00
FUJIWARA Katsunori
9cce255bec replace Python standard textwrap by MBCS sensitive one for i18n text
Mercurial has problem around text wrapping/filling in MBCS encoding
environment, because standard 'textwrap' module of Python can not
treat it correctly. It splits byte sequence for one character into two
lines.

According to unicode specification, "east asian width" classifies
characters into:

   W(ide), N(arrow), F(ull-width), H(alf-width), A(mbiguous)


W/N/F/H can be always recognized as 2/1/2/1 bytes in byte sequence,
but 'A' can not. Size of 'A' depends on language in which it is used.

Unicode specification says:

   If the context(= language) cannot be established reliably they
   should be treated as narrow characters by default

but many of class 'A' characters are full-width, at least, in Japanese
environment.

So, this patch treats class 'A' characters as full-width always for
safety wrapping.

This patch focuses only on MBCS safe-ness, not on writing/printing
rule strict wrapping for each languages

MBCS sensitive textwrap class is originally implemented
by ITO Nobuaki <daydream.trippers@gmail.com>.
2010-06-06 17:20:10 +09:00
Matt Mackall
a1c4034fda revset: add a debugrevspec command 2010-06-01 11:18:57 -05:00
Matt Mackall
86ebd43d71 remoteui: move from cmdutil to hg 2010-06-01 11:18:57 -05:00
Martin Geisler
02f8de2883 commands: document --new-branch flag for push 2010-05-25 09:57:19 +02:00
Martin Geisler
c5e5ad33a2 Merge with stable 2010-05-25 09:56:26 +02:00
Faheem Mitha
f0ea5d41d2 commands: updates to push docstring.
With contributions from mg, hstuart, timeless, and vsh.
2010-05-24 21:52:33 +05:30
Sune Foldager
f9f5488566 push: add --new-branch option to allow intial push of new branches
Compare this to --force which allows anything to be pushed. With --new-branch,
only changesets to named branches not present on the and changesets not
introducing additional heads on existing branches are allowed.

Developed by
  Henrik Stuart <henrik.stuart@edlund.dk>
  Sune Foldager <cryo@cyanite.org>
2010-05-21 15:22:29 +02:00
Martin Geisler
efb4a38a04 Use our custom hg reStructuredText role some more
I missed these occurrences on my first scan through the source.
2010-05-18 16:31:10 +02:00
Steve Losh
6c5a8fed4b tag: add -e/--edit option for modifying the commit message 2010-05-15 23:33:22 -04:00
Henri Wiechers
7134ed3f0f help: add -e/--extension switch to display extension help text 2010-01-20 20:24:20 +02:00
Martin Geisler
c1f08a81f6 debugbuilddag: read DAG from stdin if not given on cmdline 2011-05-09 18:11:08 +02:00
Martin Geisler
08ab74f879 debugbuilddag: output progress information 2011-05-09 14:40:49 +02:00
Adrian Buehlmann
4163cf2e6f rename util.find_exe to findexe 2011-05-08 20:35:46 +02:00
Patrick Mezard
e0378ee5bd patch: make patch()/internalpatch() always update the dirstate 2011-05-08 17:48:31 +02:00
Patrick Mezard
88e958194e patch: move updatedir() from cmdutil into patch
Also, create an artificial wdutil.py to avoid import cycles between patch.py
and cmdutil.py.
2011-05-08 17:48:30 +02:00
Sune Foldager
bae0240022 debugindex: change output for generaldelta revlogs
For generaldelta revlogs, reporting the deltaparent instead of the chain base
makes more sense, since that's what's actually stored in the revlog.
2011-05-07 23:14:36 +02:00
Sune Foldager
88485e9322 revlog: calculate base revisions iteratively
This is in preparation for generaldelta, where the revlog entry base field is
reinterpreted as the deltaparent. For that reason we also rename the base
function to chainbase.

Without generaldelta, performance is unaffected, but generaldelta will suffer
from this in _addrevision, since delta chains will be walked repeatedly.
A cache has been added to eliminate this problem completely.
2011-05-07 22:40:14 +02:00
Patrick Mezard
da2bf866c1 debugbuilddag: simplify tags serialization a bit 2011-05-07 17:25:02 +02:00
Wagner Bruna
8d97c7a927 commands, i18n: add translation hint for split message 2011-05-06 15:48:04 -03:00
Matt Mackall
ac5d056e58 merge with abuehl 2011-05-06 13:04:24 -05:00
Matt Mackall
05c3219fba merge with crew 2011-05-06 11:50:58 -05:00
Adrian Buehlmann
b79bd6d178 rename util.set_signal_handler to setsignalhandler 2011-05-06 15:41:04 +02:00
Peter Arrenbrecht
635fef062f summary: run discovery only once for in/out against same repo
Reuses the result of findcommonincoming if default and default-push
are the same.
2011-05-06 14:45:13 +02:00
Peter Arrenbrecht
d4abc4d642 discovery: resurrect findoutgoing as findcommonoutgoing for extension hooks
discovery.findoutgoing used to be a useful hook for extensions like
hgsubversion. This patch reintroduces this version of findcommonincoming
which is meant to be used when computing outgoing changesets.
2011-05-06 14:44:18 +02:00
Adrian Buehlmann
e981d64ef2 rename path_auditor to pathauditor
The Mercurial 1.9 release is moving a lot of stuff around anyway and we are
already moving path_auditor from util.py to scmutil.py for that release.

So this seems like a good opportunity to do such a rename. It also strengthens
the current project policy to avoid underbars in names.
2011-05-06 09:54:06 +02:00
Martin Geisler
42c642ca22 annotate: use real Booleans instead of 0/1 2011-05-06 11:11:55 +02:00
Martin Geisler
823fefa7a6 commands: use util.Abort's hint some more 2011-05-05 14:57:21 +02:00
Martin Geisler
686a64c49c commands: use double-quotes for strings with single-quotes
The globalopts table contain a couple of \' still, but it was
normalized like that in cd2bb3dda566.
2011-05-05 12:16:43 +02:00
Kevin Bullock
c38d0cc58b bookmarks: allow deactivating current bookmark with -i 2011-05-04 10:43:47 -05:00
Kevin Bullock
b95625191f bookmarks: allow to create/move bookmark without making it current (issue2788)
Adds a -i/--inactive flag to the bookmarks command to create or move a
bookmark without making it the current one. This lets you use a bookmark
like a shareable, movable 'tag' and less like a 'branch'.

Thanks to Alexander Solovyov <alexander@solovyov.net> for most of the
work of implementation, and Matt Mackall <mpm@selenic.com> for
suggesting the option name.
2010-12-11 18:08:55 +01:00
Dan Villiom Podlaski Christiansen
511c941422 prevent transient leaks of file handle by using new helper functions
These leaks may occur in environments that don't employ a reference
counting GC, i.e. PyPy.

This implies:
 - changing opener(...).read() calls to opener.read(...)
 - changing opener(...).write() calls to opener.write(...)
 - changing open(...).read(...) to util.readfile(...)
 - changing open(...).write(...) to util.writefile(...)
2011-05-02 10:11:18 +02:00
Peter Arrenbrecht
75fa0e5ea9 discovery: add new set-based discovery
Adds a new discovery method based on repeatedly sampling the still
undecided subset of the local node graph to determine the set of nodes
common to both the client and the server.

For small differences between client and server, it uses about the same
or slightly fewer roundtrips than the old tree-based discovery. For
larger differences, it typically reduces the number of roundtrips
drastically (from 150 to 4, for instance).

The old discovery code now lives in treediscovery.py, the new code is
in setdiscovery.py.

Still missing is a hook for extensions to contribute nodes to the
initial sample. For instance, Augie's remotebranches could contribute
the last known state of the server's heads.

Credits for the actual sampler and computing common heads instead of
bases go to Benoit Boissinot.
2011-05-02 19:21:30 +02:00
Peter Arrenbrecht
8960775f93 debugbuilddag: use memctx for speed
This drops the options to run arbitrary shell commands within
commits and the option to create a file that gets appended to
in every revision. It now supports to not write file data at
all, which is very fast for generating a pure 00changelog.i
(useful for discovery tests, for instance).

Timings for 1000 linear nodes:
 * Old `hg debugbuilddag -o '+1000'` took 4.5 secs.
 * New `hg debugbuilddag -o '+1000'` takes 2 secs.
 * New `hg debugbuilddag '+1000'` takes 0.8 secs.

(The last one creates only 00changelog.i).
2011-05-02 19:21:30 +02:00
Yuya Nishihara
bb70e72628 bisect: fix indent level 2011-05-02 01:29:51 +09:00
Benoit Boissinot
b805aced54 unbundler: separate delta and header parsing
Add header parsing for changelog and manifest (currently no headers might
change for next-gen bundle).
2011-04-30 19:01:24 +02:00
Benoit Boissinot
c5f5260aea bundler: make parsechunk return the base revision of the delta 2011-04-30 10:00:41 +02:00
Alexander Solovyov
2f6ab6bf04 revset aliases 2011-04-30 18:30:14 +02:00
Brodie Rao
b7f0d2a103 url: move URL parsing functions into util to improve startup time
The introduction of the new URL parsing code has created a startup
time regression. This is mainly due to the use of url.hasscheme() in
the ui class. It ends up importing many libraries that the url module
requires.

This fix helps marginally, but if we can get rid of the urllib import
in the URL parser all together, startup time will go back to normal.

perfstartup time before the URL refactoring (707e4b1e8064):

! wall 0.050692 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)

current startup time (9ad1dce9e7f4):

! wall 0.070685 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)

after this change:

! wall 0.064667 comb 0.000000 user 0.000000 sys 0.000000 (best of 100)
2011-04-30 09:43:20 -07:00
Peter Arrenbrecht
b867e650e6 discovery: drop findoutgoing and simplify findcommonincoming's api
This is a long desired cleanup and paves the way for new discovery.
To specify subsets for bundling changes, all code should use the heads
of the desired subset ("heads") and the heads of the common subset
("common") to be excluded from the bundled set. These can be used
revlog.findmissing instead of revlog.nodesbetween.

This fixes an actual bug exposed by the change in test-bundle-r.t
where we try to bundle a changeset while specifying that said changeset
is to be assumed already present in the target. This used to still
bundle the changeset. It no longer does. This is similar to the bugs
fixed by the recent switch to heads/common for incoming/pull.
2011-04-30 17:21:37 +02:00
Alexander Solovyov
0eb3836642 remove unused imports and variables 2011-04-30 13:59:14 +02:00
Alexander Solovyov
23228e2ea0 drop {short,hex}(ctx.node()) calls in favor of ctx methods 2011-04-30 12:55:07 +02:00
Peter Arrenbrecht
9855dca4f8 wireproto: add test for new optional arg missing on server
New argument is silently ignored by both HTTP and SSH servers.
This means we can, for instance, add new flags to getbundle()
to request advanced features (like lightweight-copy-aware bundles),
and older servers will silently ignore this request and send back
a plain bundle.
2011-04-29 14:54:01 +02:00
Martin Geisler
539e56249b merge with stable 2011-04-26 13:13:35 +02:00
Adrian Buehlmann
9a67b02dba move rcpath from util to scmutil 2011-04-21 20:14:29 +02:00
Adrian Buehlmann
307196b733 move path_auditor from util to scmutil 2011-04-20 22:43:31 +02:00
Adrian Buehlmann
cf126bb7dd move opener from util to scmutil 2011-04-20 19:54:57 +02:00
Matt Mackall
27af4239ba merge with stable 2011-04-20 12:44:32 -05:00
Idan Kamara
392e524251 update: fix check for no rev when a date is given
The previous check caught a corner case in which rev
was pointing to 0.
2011-04-19 14:56:46 +03:00
Matt Mackall
3960f4de1d merge with stable 2011-04-18 20:52:08 -05:00
Idan Kamara
3adc383a95 identify: restructure code to make it more readable 2011-04-19 01:08:35 +03:00
Adrian Buehlmann
3efb31d590 help: do not show full help text for command on option errors
Example

  $ hg clone --jump foo bar
  hg clone: option --jump not recognized
  hg clone [OPTION]... SOURCE [DEST]

  make a copy of an existing repository

  options:

   -U --noupdate           the clone will include an empty working copy (only a
                           repository)
   -u --updaterev REV      revision, tag or branch to check out
   -r --rev REV [+]        include the specified changeset
   -b --branch BRANCH [+]  clone only the specified branch
      --pull               use pull protocol to copy metadata
      --uncompressed       use uncompressed transfer (fast over LAN)
   -e --ssh CMD            specify ssh command to use
      --remotecmd CMD      specify hg command to run on the remote side
      --insecure           do not verify server certificate (ignoring
                           web.cacerts config)

  [+] marked option can be specified multiple times

  use "hg help clone" to show the full help text

Motivation for this change

  If the user already has specified the command, he probably already knows
  the command to some extent. Apparently, he has a problem with the options,
  so we show him just the synopsis with the short help and the details about
  the options, with a hint on the last line how to get the full help text.

Why is Mercurial better with this change?

  Experts who just forgot about the details of an option don't get that
  much text thrown at them, while the newbies still get a hint on the last
  line how to get the full help text.
2011-04-17 11:37:11 +02:00
Md. O. Shayan
475f1c2d09 grep: don't print data from binary files for matches (issue2614) 2011-04-09 23:13:17 +05:30
Idan Kamara
17914fe278 bookmarks: change error messages to match those given by 'hg tag' commands 2011-04-07 17:57:38 +03:00
Martin Geisler
43d795e497 commit: note when files are missing
Before, you could experience the following strange interaction:

  $ hg commit
  nothing changed
  $ hg merge
  abort: outstanding uncommitted changes

which confused at least one user in #mercurial.
2011-04-06 16:21:12 +02:00
Idan Kamara
bcbd1c4dc5 tags: no need to check for valid nodes
_findtags in localrepo checks that nodes exist in the revlog so we
can't get a LookupError here.

The output of 'hg tags' stays the same since tags to unknown nodes
didn't get printed before anyway due to 734bab2916a6.
2011-04-04 23:43:22 +03:00
Arne Babenhauserheide
8fe2ac6071 merge: added info that hg help merge-tools shows the options for --tool 2011-04-05 19:48:44 +02:00
Matt Mackall
a8dd64dcb0 misc: replace .parents()[0] with p1() 2011-04-04 16:21:59 -05:00
Adrian Buehlmann
9db9ae7e0e revert: note that added files are left as is 2011-04-01 22:44:58 +02:00
Kevin Berridge
58214a3429 pull: new output message when there are multiple branches
Pull outputs a slightly new message when there are multiple branches and
the current branch has many heads:
(run 'hg heads .' to see heads, 'hg merge' to merge)

This message adds the "." in hg heads to encourage you to consider only the
current branch's heads.
2011-03-28 20:56:56 -04:00
Kevin Berridge
87ae31d662 pull: don't suggest running hg merge when new heads are on different branches
After a pull when new heads are added but no head is added on the current
branch, the "run 'hg merge'" message can be misleading.  This patch doesn't
output the merge message in that scenario.
2011-03-11 20:43:12 -05:00
Adrian Buehlmann
af6e59941f debugstate: add new --datesort option
sorts the output lines by mtime, then by filename
2011-03-26 10:59:33 +01:00
Patrick Mezard
92074cd441 patch: deprecate ui.patch / external patcher feature
Why?
- Mercurial internal patcher works correctly for regular patches and git
  patches, is much faster at least on Windows and is more extensible.
- In theory, the external patcher can be used to handle exotic patch formats. I
  do not know any and have not heard about any such use in years.
- Most patch programs cannot handle git format patches, which makes the API
  caller to decide either to ignore ui.patch by calling patch.internalpatch()
  directly, or take the risk of random failures with valid inputs.
- One thing a patch program could do Mercurial patcher cannot is applying with
  --reverse. Apparently several shelve like extensions try to use that,
  including passing the "reverse" option to Mercurial patcher, which has been
  removed mid-2009. I never heard anybody complain about that, and would prefer
  reimplementing it anyway.

And from the technical perspective:
- The external patcher makes everything harder to maintain and implement. EOL
  normalization is not implemented, and I would bet file renames, if supported
  by the patcher, are not correctly recorded in the dirstate.
- No tests.

How?
- Remove related documentation
- Clearly mark patch.externalpatch() as private
- Remove the debuginstall check. This deprecation request was actually
  triggered by this last point. debuginstall is the only piece of code patching
  without a repository. When migrating to an integrated patch() + updatedir()
  call, this was really a showstopper, all workarounds were either ugly or
  uselessly complicated to implement. If we do not support external patcher
  anymore, the debuginstall check is not useful anymore.
- Remove patch.externalpatch() after 1.9 release.
2011-03-24 10:28:29 +01:00
Patrick Mezard
4e7e0fa921 code indentation fixes 2011-03-23 23:33:14 +01:00
Peter Arrenbrecht
6646f48826 wireproto: add getbundle() function
getbundle(common, heads) -> bundle

Returns the changegroup for all ancestors of heads which are not ancestors of common. For both
sets, the heads are included in the set.

Intended to eventually supercede changegroupsubset and changegroup. Uses heads of common region
to exclude unwanted changesets instead of bases of desired region, which is more useful and
easier to implement.

Designed to be extensible with new optional arguments (which will have to be guarded by
corresponding capabilities).
2011-03-23 16:02:11 +01:00
Matt Mackall
70da923d41 debugbundle: fix up long line caught by check-code 2011-03-22 21:27:51 -05:00
Peter Arrenbrecht
4e49d0830f commands: add debugbundle command
Lists ids contained in a bundle file. Useful for testing bundle-related commands.
2011-03-22 09:22:29 +01:00
Peter Arrenbrecht
d542bac8c7 wireproto: add known([id]) function
known([Node]) -> [1/0]

Returns 1/0 for each node, indicating whether it's known by the server.
Needed for new discovery protocols introduced in later patches.
2011-03-22 09:22:21 +01:00
Peter Arrenbrecht
375ab88b9f debug: add debugwireargs to test argument passing over the wire
Tests argument passing locally, via HTTP, and via SSH. This is mainly preparation
for the next patch.
2011-03-22 07:38:32 +01:00
Matt Mackall
ca9fdc1884 annotate: catch nonexistent files using match.bad callback (issue1590) 2011-03-19 01:34:49 -05:00
Matt Mackall
9bb3fa8c69 merge with stable 2011-03-17 17:08:13 -05:00
Bernhard Leiner
baf797018e revset: report a parse error if a revset is not parsed completely (issue2654) 2011-03-16 23:09:14 +01:00