Commit Graph

5307 Commits

Author SHA1 Message Date
Matt Mackall
eba820848f Merge with crew 2009-07-27 18:38:20 -05:00
Dan Villiom Podlaski Christiansen
46be30bb99 dirstate: fold paths using the just added util.realpath() function.
Using the one true canonical path of a directory entry allows
equivalent paths to be treated gracefully. Equivalent means, in this
case, differing directory entries resulting in the same, unique file
system link to a file.
2009-07-26 18:02:06 +02:00
Dan Villiom Podlaski Christiansen
5cd95d0ef8 util: add realpath() for getting the 'true' path.
The function is implemented for Mac OS X using the F_GETPATH fcntl,
and a basic implementation for Windows is provided as well. On other
POSIX systems, vanilla os.path.realpath() is used.
2009-07-26 17:25:08 +02:00
David Soria Parra
b8eb153b05 commands: Check if helptext contains a newline before we split 2009-07-27 02:12:17 +02:00
Martin Geisler
e806769158 help: wrap help strings at 70 characters 2009-07-26 02:12:53 +02:00
Martin Geisler
050ea36350 commands: wrap docstrings at 70 characters
It is no longer necessary to wrap the docstrings at 70 characters in
the source -- with the reST parser, they are re-formatted to fit the
terminal when shown.

However, wrapping the docstrings at 78 characters makes life harder
for translators because it marks a lot of strings as fuzzy for no good
reason. When un-marking them, the translators would have to examine
each string again and determine if it is merely re-wrapped or if the
content was also changed.

The long lines also introduce very ugly linebreaks in the .po files if
they are processed using the standard Gettext tools without using
something like '--width 85' all the time.
2009-07-26 01:33:00 +02:00
Greg Ward
b42121b634 transaction: document close(), abort() methods 2009-07-21 20:31:45 -04:00
Dirkjan Ochtman
da9d2d8f2b merge with crew-stable 2009-07-23 20:44:26 +02:00
Bryan O'Sullivan
2f16501cf7 Merge with crew-stable 2009-07-22 15:28:30 -07:00
Martin Geisler
ae0794fd45 coding style: use a space after comma
I left a cases like 'lambda x,y:' alone -- the lack of a space does
not bother me as much when the variables are single letters.
2009-07-22 23:12:54 +02:00
Martin Geisler
80783827fb commands: remove ineffective parenthesis 2009-07-22 23:08:32 +02:00
Martin Geisler
f69f24cd76 merge with crew-stable 2009-07-22 22:56:45 +02:00
Patrick Mezard
5b2d10b6fe Merge with crew-stable 2009-07-19 18:28:43 +02:00
Martin Geisler
b61af83551 hg: better wrapping of string literal 2009-07-17 20:52:21 +02:00
Matt Mackall
5cf070ede1 Merge with crew 2009-07-18 12:41:49 -05:00
Matt Mackall
d8c1b12a59 changelog: move delayopener outside of class to eliminate reference cycle 2009-07-18 12:34:38 -05:00
Matt Mackall
58b70ccd45 changelog: swap opener to switch delay modes 2009-07-18 11:26:35 -05:00
Matt Mackall
853050477c changelog: factor out _delayname 2009-07-18 11:25:55 -05:00
Matt Mackall
bda87e75ac changelog: _delaycount -> _divert 2009-07-18 11:25:54 -05:00
Brendan Cully
09920a4acd Merge with hg 2009-07-16 21:05:24 -07:00
Martin Geisler
f92187f9e3 help: fix bad indentation in template filters list
The indentation showed up in the hg.1.html file.
2009-07-16 23:25:26 +02:00
Martin Geisler
92882a99d0 doc: use reStructuredText for man and HTML pages
The Makefile now requires the rst2html and rst2man programs. Both can
be found in Debian testing or downloaded from the Docutils homepage:

  http://docutils.sf.net/
  http://docutils.sf.net/sandbox/manpage-writer/

The new HTML and man pages no longer contain huge amounts of
un-wrapping literal blocks, thanks to how snippets of reStructuredText
can easily be included inside other reStructuredText documents.

The HTML pages now have anchors for all sections, including the help
topics in hgrc.1 which were missing from the old HTML pages.
2009-07-16 23:25:26 +02:00
Martin Geisler
3951831e0b commands: use minirst parser when displaying help 2009-07-16 23:25:26 +02:00
Martin Geisler
7953ecf0bd minimal reStructuredText parser 2009-07-16 23:25:25 +02:00
Martin Geisler
607267cbbc util: wrap at termwidth-2 by default 2009-07-16 23:25:25 +02:00
Matt Mackall
9f21c99975 Merge with stable 2009-07-16 15:40:13 -05:00
Matt Mackall
a57f5b2b3b Add ui.progress API 2009-07-16 14:49:52 -05:00
Greg Ward
da8b780a58 tags: support 'instant' tag retrieval (issue548)
- modify _readtagcache() and _writetagcache() to read/write tag->node
  mapping for global tags
- if (and only if) tip unchanged, use that cached mapping to avoid
  reading any revisions of .hgtags
- change so tag names are UTF-8 in memory in tags.py, and converted to
  local encoding as late as possible (in localrepository._findtags())
2009-07-16 10:41:19 -04:00
Greg Ward
81e6782a86 tags: implement persistent tag caching (issue548).
- rename findglobaltags() to findglobaltags1() (so the "no cache"
  implementation is still there if we need it)
- add findglobaltags2() and make findglobaltags() an alias for it
  (disabling tag caching is a one-line patch)
- factor out tagcache class with methods readcache() and writecache();
  the expensive part of tag finding (iterate over heads and find
  .hgtags filenode) is now in tagcache.readcache()
2009-07-16 10:39:42 -04:00
Greg Ward
0487eef6d6 localrepo: add destroyed() method for strip/rollback to use (issue548). 2009-07-16 10:39:41 -04:00
Greg Ward
5aa64bf085 Factor tags module out of localrepo (issue548).
Currently only handles reading tags, and will soon grow support for
tag caching.  Could eventually deal with updating tags too.
2009-07-16 10:39:41 -04:00
Greg Ward
0a46ad48e3 localrepo: factor updatetags() out of readtags() (issue548). 2009-07-16 10:39:41 -04:00
Greg Ward
310d950984 localrepo: improve readability of _findtags(), readtags() (issue548).
- rename many local variables
- add some comments
- refactor call to line.split() (catch ValueError rather
  than checking length of return value: one less local variable)
2009-07-16 10:39:41 -04:00
Greg Ward
37b1525e95 localrepo: rename in-memory tag cache instance attributes (issue548).
- self.tagscache to self._tags
- self._tagstypecache to self._tagtypes
- this is for consistency, readability, privacy, and to subtly hint
  that "caching" is something else
2009-07-16 10:39:41 -04:00
Greg Ward
b0c72fe36d localrepo: factor _findtags() out of tags() (issue548).
This makes in-memory caching the sole responsibility of localrepo,
eliminating some localrepo code that was duplicated in mq and
bookmarks.
2009-07-16 10:39:41 -04:00
Martin Geisler
a2bda0adf6 merge with crew-stable 2009-07-15 17:44:47 +02:00
Brendan Cully
a36fa86497 Merge with crew-stable 2009-07-14 18:00:37 -07:00
Brendan Cully
330d2aecf7 Merge with crew-stable 2009-07-14 16:51:52 -07:00
Martin Geisler
19770adfb7 merge with crew-stable 2009-07-15 00:19:15 +02:00
Nicolas Dumazet
7eadbe8d42 for calls expecting bool args, pass bool instead of int
str.splitlines and email.message.as_string both expect a bool argument
defaulting at False: replace f(1) by f(True) and f(0) by f()
2009-07-13 09:50:26 +09:00
Martin Geisler
bfee32e919 merge with crew-stable 2009-07-14 20:10:23 +02:00
Simon Heimberg
4ba52122d6 util: use propertycache in opener instead of __getattr__ 2009-07-10 17:54:04 +02:00
Martin Geisler
8939e5b2b0 merge with crew-stable 2009-07-10 12:49:29 +02:00
Matt Mackall
eb6cba34d7 Merge with stable 2009-07-09 19:49:02 -05:00
Abderrahim Kitouni
45a072d541 subrepo: use hg.repository instead of creating localrepo directly
this way, extensions' reposetup will be called, which allows for git
subrepos to be handled by hg-git (and I believe the same goes for
svn and hgsubversion)
2009-07-04 14:18:15 +01:00
Brendan Cully
afaf6c9af8 ignore: separate pattern extraction from match compilation
hgignore files have slightly different syntax from match objects,
e.g. syntax: foo headers, regexp: forms, and re being relre. Put
conversion from hgignore syntax into match syntax into a standalone
function so that it is easier to validate hgignore hunks externally.
2009-07-09 15:14:42 -07:00
Martin Geisler
a94a165c74 merge with crew-stable 2009-07-09 11:59:56 +02:00
Martin Geisler
0d6a5ead82 typos: "it's" -> "its" 2009-07-08 23:17:10 +02:00
Bryan O'Sullivan
c5ab2a3c14 Merge OS X performance regression fix 2009-07-08 17:03:50 -07:00
Martin Geisler
0edf2321f8 help: wrapped help strings at 78 characters 2009-07-08 17:14:24 +02:00
Martin Geisler
be9af22b8a commands: avoid bad linebreak in addremove docstring 2009-07-08 00:30:21 +02:00
Martin Geisler
a53360d76e commands: wrapped docstrings at 78 characters
We have always had a left margin of 4 characters -- probably just
because that's how docstrings for top-level functions turn out by
default, but it also looks nice in the built-in help.

The docstrings were wrapped at 70 characters, which is the default for
Emacs. However, this gives a right margin of 10 characters in a
standard 80 character terminal.

I've now wrapped the relevant docstrings at 78 characters, effectively
killing the right margin. The asymmetric margins looked a bit odd and
some of the text looked cramped with a right margin, so Dirkjan and I
felt that it was best to remove it entirely. The two character gap was
kept to have some space between the border of the terminal -- it will
also make diffs involving the docstrings fit in a 80 character line.
2009-07-07 23:54:30 +02:00
Martin Geisler
ecfc8a98d6 filemerge, subrepo: correct indention 2009-07-07 17:26:20 +02:00
Simon Heimberg
e0e4fc74e3 ui: extract choice from prompt
avoid translating single characters (as l for _local or sym_link)
2009-06-21 01:13:19 +02:00
Martin Geisler
a8dfb6533c localrepo: removed unnecessary revkey sort helper 2009-07-05 12:43:40 +02:00
Alejandro Santos
5eb00dc7df compat: remove unnecessary diamond-shaped multiple inheritance 2009-07-05 11:06:41 +02:00
Alejandro Santos
ebe339890f split local and stdlib module imports (eases migration issues) 2009-07-05 11:06:09 +02:00
Alejandro Santos
41ce14a033 compat: don't reference an exception var inside a lambda 2009-07-05 11:05:31 +02:00
Alejandro Santos
ba9d64878c compat: use email in favor of mimetools 2009-07-05 11:04:55 +02:00
Alejandro Santos
bc1b8b3654 verify: fix scope issues with del statement 2009-07-05 11:04:31 +02:00
Alejandro Santos
1ef2fb42a7 compat: use 'key' argument instead of 'cmp' when sorting a list 2009-07-05 11:02:00 +02:00
Alejandro Santos
77d606ac51 compat: use open() instead of file() everywhere 2009-07-05 11:01:30 +02:00
Alejandro Santos
b1c42d384b compat: can't compare two values of unequal datatypes 2009-07-05 11:01:01 +02:00
Alejandro Santos
3183e52503 compat: use // for integer division 2009-07-05 11:00:44 +02:00
Greg Ward
acf5297c3a context: improve arg-checking assert. 2009-07-03 10:43:46 -04:00
David Wolever
a527dcec27 help: add #revision syntax to the example valid URLs. 2009-07-04 12:40:34 +02:00
Cédric Duval
1fafb1baee extensions: remove dead code
enabled used to be a boolean, and somehow that bit of code inadvertently
slipped through during a refactoring. Effectively dead code, as the
condition can never be triggered.
2009-07-04 12:06:33 +02:00
Cédric Duval
6577113132 bisect: fix format specifiers for integers 2009-07-01 23:15:26 +02:00
Martin Geisler
a9670d9567 util: remove unused bufsize argument in popen[23] 2009-05-09 17:34:11 +02:00
Martin Geisler
e8bc5f4f01 util: remove ignored mode argument in popen[23] 2009-05-09 17:32:57 +02:00
Martin Geisler
110a176288 copies: don't translate untranslatable string 2009-05-09 14:56:06 +02:00
Stefano Mioli
498646a2c2 commands: improve bundle compression methods description 2009-06-28 13:56:34 +02:00
Brendan Cully
8fec927bcc help: branch heads have no descendants, not no children 2009-06-29 08:48:05 -07:00
Brendan Cully
e55703261f Branch heads should not include "heads" that are ancestors of other heads.
For example, given 1 (branch a) -> 2 (branch b) -> 3 (branch a)
I expect "hg heads a" to show only 3.
Discovered by running hg heads HEAD on the mutt repo, where older clients
committed default on top of HEAD.
2009-06-29 00:54:23 -07:00
Henrik Stuart
97f9be9c1f windows: fix use of undefined exception (issue1707)
This fixes the implied reliance on pywin32 and the win32 module. This
also fixes a regression in fe7c89838a64 that made Mercurial unusable
without pywin32.
2009-06-25 22:43:58 +02:00
Matt Mackall
34cb6b5080 addremove: drop some silly variable assignments 2009-06-23 17:51:51 -05:00
Mads Kiilerich
4f97bc02c9 ui.prompt: Show prompt and selection in non-interactive mode
ui.prompt was completely silent in non-interactive mode, unless in verbose
mode. It is fine that it chooses the default automatically, but it is confusing
that the message and prompt shown interactively can't be found in scripted
tests.

The prompt and selection is now .write'ed instead of .note'ed.
2009-06-21 03:13:38 +02:00
Martin Geisler
1454ed1684 commands: wrap short descriptions in 'hg help'
The code for wrapping a single line of text with a hanging indent was
duplicated in commands and help -- it's now moved to a new function
called wrap in util.

The function defaults to a line width is 78 chars, and this un-wraps
some command line flag descriptions, hence the test output changes.
2009-06-24 19:15:58 +02:00
Martin Geisler
6267399c7d commands: add "--" to command line flag in branches docstring 2009-06-24 18:40:13 +02:00
Dirkjan Ochtman
1d29e68744 change wiki/bts URLs to point to new hostname 2009-06-24 15:32:37 +02:00
Dirkjan Ochtman
26c979b536 help: rewrap extension description line length at 78 instead of 70 2009-06-24 13:10:05 +02:00
Dirkjan Ochtman
4240802763 commands: add note about import retrieving patches from URLs 2009-06-24 12:04:19 +02:00
Dirkjan Ochtman
115b52ec56 windows: import WinIOError from win32 module (issue1707)
Quick fix pending further refactoring of windows error handling.
2009-06-24 12:03:53 +02:00
Matt Mackall
e869264d04 Merge with i18n 2009-06-23 15:43:09 -05:00
Martin Geisler
e032f8f8c6 merged with crew 2009-06-22 22:22:48 +02:00
Cédric Duval
295c588e3f extensions: remove import rendered unnecessary by 69a0fe38731b 2009-06-21 20:34:58 +02:00
Cédric Duval
6d8eae2087 help: fixing non-matching example texts 2009-06-21 20:35:20 +02:00
Simon Heimberg
66c4ab1cbf patch: use new style class in linereader 2009-06-22 12:05:11 +02:00
Martin Geisler
5d560b33c1 commands: removed redundant line from push docstring 2009-06-21 19:12:03 +02:00
Martin Geisler
16155b528f merged with crew 2009-06-21 19:06:57 +02:00
Cédric Duval
16497ecd09 help: more improvements for the extensions topic
- improve help text English (thanks to timeless for corrections)
- rename and simplify functions a little bit, improved comments
2009-06-21 17:52:30 +02:00
Cédric Duval
f2fdd668fb extensions: use _order to determine if an extension is enabled 2009-06-21 17:19:34 +02:00
Cédric Duval
18fcf35d02 extensions: check for path existence only when necessary 2009-06-21 17:18:48 +02:00
Dirkjan Ochtman
ac890b2ded extensions: remove now-useless pathdirs() function 2009-06-21 17:35:04 +02:00
Dirkjan Ochtman
173d136a98 extensions: simplify by selecting primary hgext 2009-06-21 16:35:44 +02:00
Cédric Duval
17141a61d0 extensions: move extensions listing functions from mercurial.help
Includes some small fix-ups to comments in enabled() and disabled().
2009-06-21 16:32:00 +02:00
Dirkjan Ochtman
0d5412917a serve: obey the --encoding option 2009-06-21 16:27:07 +02:00
Sune Foldager
f5c1bbf245 translated a bunch of strings to danish 2009-06-20 19:46:01 +02:00
Cédric Duval
9fac1a66d9 help: expand the extensions topic 2009-06-20 20:55:50 +02:00
Cédric Duval
ecdc3822ca help: refactor extensions listing, and show enabled ones in the dedicated topic 2009-06-20 20:55:49 +02:00
Cédric Duval
06cac940ef help: adding a new help topic about extensions
Currently listing non-enabled extensions and a short introductory text.

Thanks to Dan Villiom Podlaski Christiansen for the preliminary
proof-of-concept code for listing available extensions.
2009-06-20 20:55:43 +02:00
Matt Mackall
7849adbee8 filemerge: fix internal:dump 2009-06-20 16:42:51 -05:00
Benoit Boissinot
a082a7dc75 hgweb: deny cloning a subpath of a repo 2009-06-20 16:42:51 -05:00
Matt Mackall
067d110f29 hgweb: web.encoding should override encoding.encoding (issue1183) 2009-06-20 13:00:25 -05:00
Matt Mackall
9d8806e3c3 bdiff: fix compile with GCC -ansi (issue1690) 2009-06-20 11:50:51 -05:00
Matt Mackall
689cdd2284 tags: silence warning about unknown tags
This is mostly a nuisance and can happen legitimately with pull -r, etc.
2009-06-20 10:53:47 -05:00
Matt Mackall
c2f64c423c rollback: minor clarification (issue828) 2009-06-20 09:00:02 -05:00
Matt Mackall
1ca56aef1e update: add --check option 2009-06-20 08:29:41 -05:00
Dongsheng Song
4e62c61983 Fix warning: Seen unexpected token "%" 2009-06-19 14:28:29 +08:00
Matt Mackall
0524b599b7 tags: drop nested function 2009-06-18 23:08:33 -05:00
Matt Mackall
2d1077e9a8 tags: generate contexts directly 2009-06-18 23:04:54 -05:00
Matt Mackall
caca0c5d48 tags: reverse and simplify head-walking 2009-06-18 20:50:35 -05:00
Matt Mackall
536867428a tags: simplify rev handling 2009-06-18 20:50:33 -05:00
Matt Mackall
45eb44ee7b tags: fold in _hgtagsnodes 2009-06-18 20:49:50 -05:00
Matt Mackall
fed8f4af82 filemerge: add internal:dump
This create foo.{local,other,base} files for people to manually merge
files while littering their working directory.
2009-06-18 16:56:03 -05:00
Matt Mackall
48da4c1c20 filemerge: add internal:prompt target 2009-06-18 16:56:02 -05:00
Martin Geisler
f0f091167f help: wrap extension descriptions 2009-06-22 00:02:31 +02:00
Greg Ward
d4545cca8c help: improve grammar/wording of 'extensions' topic 2009-06-21 11:23:16 -04:00
Colin Caughie
53aca7b1bf Fixed patch.eol bug that truncated all patched lines to one character
Also updated the import-eol test to test with lines longer than one character,
and also empty lines.
2009-06-16 16:22:42 +01:00
Matt Mackall
459bbfbb56 subrepo: basic push support 2009-06-15 02:46:20 -05:00
Matt Mackall
430046de97 subrepo: add update/merge logic 2009-06-15 02:45:38 -05:00
Matt Mackall
fd08adf4d6 commit: recurse into subrepositories 2009-06-15 02:45:38 -05:00
Matt Mackall
ce2e49a0da subrepo: introduce basic state parsing 2009-06-15 02:45:38 -05:00
Patrick Mezard
c1548a6a3e Add patch.eol to ignore EOLs when patching (issue1019)
The intent is to fix many issues involving patching when win32ext is enabled.
With win32ext, the working directory and repository files EOLs are not the same
which means that patches made on a non-win32ext host do not apply cleanly
because of EOLs discrepancies. A theorically correct approach would be
transform either the patched file or the patch content with the
encoding/decoding filters used by win32ext. This solution is tricky to
implement and invasive, instead we prefer to address the win32ext case, by
offering a way to ignore input EOLs when patching and rewriting them when
saving the patched result.
2009-06-15 00:03:26 +02:00
Matt Mackall
f004f8a57f share: allow dest to default to the basename of source 2009-06-13 18:16:44 -05:00
Matt Mackall
6d110ab62c Merge with crew 2009-06-13 18:08:51 -05:00
Matt Mackall
3132e79527 add helper function to create shared repos 2009-06-13 18:01:47 -05:00
Matt Mackall
66b213eda6 repo: add internal support for sharing store directories
set .hg/sharedpath to point to the .hg to share with
2009-06-13 18:01:46 -05:00
Patrick Mezard
3ce6a90f5f bisect: improve --command output
- Display tested revisions without --verbose
- Display revision number
2009-06-13 23:02:51 +02:00
Patrick Mezard
6d36e612e9 dirstate: fix typo introduced by ceed02d64e3b 2009-06-13 22:42:16 +02:00
Patrick Mezard
c30fe9a6df bisect: fix traceback when command executable is not found 2009-06-13 22:42:13 +02:00
Matt Mackall
7253321c4e remoteui: properly create dst with copy() 2009-06-12 02:19:51 -05:00
Matt Mackall
da6d619643 repo: set up ui and extensions earlier 2009-06-13 14:44:59 -05:00
John Mulligan
8806103077 localrepo: remove 'closed' argument to heads(...) function
- repository heads are not associated with the closed attribute, so
remove it making the code in line with the concept.
- Fix functions that were calling heads with the parameter.
- Adjust webcommands.branches to include the concept of inactive
as well as open and closed branches
- Fix code and docstrings in commands to make the correct use of
closed branches & branch heads clearer
- Improve grammar of 'hg heads' help text (2nd submission)

this does not alter the cli for hg branches, that work is
still to be done
2009-06-10 19:11:49 -04:00
Nicolas Dumazet
448395f76a cmdutil: service: logfile option to redirect stdout & stderr in a file 2009-05-25 18:14:32 +09:00
Benoit Boissinot
62eea686e0 atomictempfile: fix exception in __del__ if mktempcopy fails (self._fp is None)
Make what is going on more obvious by explicitely getting the 'closed'
attribute from _fp, instead of from the gettatr proxy.
2009-06-13 13:14:02 +02:00
timeless
52c84115f8 Improve English for help text of many core hg commands.
co-author: Greg Ward <greg-hg@gerg.ca>
2009-06-09 21:51:34 -04:00
Benoit Boissinot
125a85ec87 use new style classes 2009-06-10 15:10:21 +02:00
timeless
fb33de67af Generally replace "file name" with "filename" in help and comments. 2009-06-09 09:25:17 -04:00
timeless
3ccbc308d0 Spell Mercurial as a proper noun 2009-06-09 09:25:31 -04:00
Matt Mackall
826dfe5eff merge: refactor manifestmerge init to better report effective ancestor 2009-06-08 18:14:44 -05:00
Matt Mackall
664da24230 merge: simplify file revision comparison logic 2009-06-08 18:14:44 -05:00
Matt Mackall
8021cf3e72 merge: make locally-added file test more correct 2009-06-08 18:14:44 -05:00
Matt Mackall
7c7918e441 merge: drop unused diverge initialization 2009-06-08 18:14:44 -05:00
Matt Mackall
810956c62b merge: refactor some initialization, drop backwards var 2009-06-08 18:14:44 -05:00
Matt Mackall
a9d2386a66 merge: combine a copy and move case 2009-06-08 18:14:44 -05:00
Matt Mackall
74a311ea36 merge: drop a flag update case 2009-06-08 18:14:44 -05:00
Matt Mackall
40f6d9b1a4 merge: combine three identical 'remote is newer' cases 2009-06-08 18:14:44 -05:00
Matt Mackall
b9716ff4b9 merge: drop 'remote deleted' case 2009-06-08 18:14:44 -05:00
Matt Mackall
68db9b76df merge: simplify 'other deleted' case 2009-06-08 18:14:44 -05:00
Matt Mackall
003d63fe39 merge: simplify backwards revert test, ready to combine with other cases 2009-06-08 18:14:44 -05:00
Matt Mackall
e7ff3ff5bc merge: allow merging going backwards
New behavior is generally superior and more correct, except possibly
with regards to missing files. hg up . is now effectively a no-op,
which is probably the desired behavior for people expecting to move to
tip, but may surprise people who were expecting deleted files to
reappear.

case 1: update to .

a-w -> a-w

classic: ancestor a
 missing     recreated     right?
 rmed        recreated     WRONG
 added       forgotten     WRONG
 changed     preserved     RIGHT
 conflicted  can't happen

backward merge: ancestor a  (NO EFFECT)
 missing     missing      wrong?
 rm'ed       rm'ed        RIGHT
 added       preserved	  RIGHT
 changed     preserved    RIGHT
 conflicted  can't happen

case 2: update to ancestor of .

a-b-w -> b-w
          \
           a

classic:  ancestor a
 missing       recreated        right?
 rmed          recreated        wrong?
 added         forgotten        wrong?
 changed       preserved        RIGHT
 conflicted    preserved        wrong?

backwards merge: ancestor b
 missing       missing or conflict  right?
 rm'ed         missing or conflict  right?
 changed       preserved            RIGHT
 conflicted    merge                RIGHT
 added         preserved            right?
2009-06-08 18:14:44 -05:00
Matt Mackall
c24a0d4e76 merge: reorder remote creation tests 2009-06-08 18:14:44 -05:00
Matt Mackall
58ccf87682 merge: drop recreating case 2009-06-08 18:14:44 -05:00
Matt Mackall
65d08ecb3f merge: drop an overwrite test 2009-06-08 18:14:44 -05:00
Matt Mackall
fee35db526 merge: simplify a delete case 2009-06-08 18:14:44 -05:00
Matt Mackall
3d83e5d92a merge: reorder get cases for future simplification 2009-06-08 18:14:44 -05:00
Matt Mackall
7d4488886a merge: fix prompt keep 2009-06-08 18:14:44 -05:00
Matt Mackall
2c65849ffa merge: remove a flags case 2009-06-08 18:14:44 -05:00
Matt Mackall
da4ac4f699 merge: pretend ancestor is local to simplify backwards and overwrite 2009-06-08 18:14:44 -05:00
Matt Mackall
60cf366277 merge: simplify flag merging code slightly 2009-06-08 18:14:44 -05:00
Matt Mackall
edecde7d3c dirstate: eliminate reference cycle from normalize
Bound methods hold a reference to self, so assigning a bound method to
an instance unavoidably creates a cycle. Work around this by choosing
a normalize method at walk time instead. Eliminate default arg while
we're at it.
2009-06-08 18:14:44 -05:00
Henri Wiechers
4269cb82b8 cleanup: removed unused imports 2009-06-07 21:16:05 +02:00
Brendan Cully
9c33729b44 Merge with crew-stable 2009-06-06 13:37:41 -07:00
Arne Babenhauserheide
5ded475334 Some platforms lack the PATH_MAX definition (eg. GNU/Hurd).
Thanks to ronny for making it cleaner.
2009-06-05 15:08:45 +02:00
Matt Mackall
56c9dee4e1 context: add a dirty method to detect modified contexts 2009-06-04 16:21:55 -05:00
Matt Mackall
7c6f521b8f dirstate: don't complain about 0-length files 2009-06-04 16:21:09 -05:00
Matt Mackall
5ae9b1fb50 commit: move some setup outside the lock 2009-06-04 16:21:03 -05:00
Dirkjan Ochtman
176bc50a2d hgweb: allow distinction between open/closed branches on branches page 2009-06-04 18:05:50 +02:00
Matt Mackall
243b33c531 commit: rename wctx to cctx 2009-06-03 17:12:48 -05:00
Matt Mackall
8b6f125b5e commit: trade O(n^2) file checks for O(n^2) dir checks 2009-06-01 22:13:08 -05:00
Matt Mackall
fcb44e87db commit: move explicit file checking into repo.commit 2009-06-01 21:51:00 -05:00
Matt Mackall
11d4ab2e09 dirstate: more accurate use of match.dir callback 2009-06-01 20:25:01 -05:00
Matt Mackall
7c83f8b030 commit: editor reads file lists from provided context 2009-06-01 14:51:47 -05:00
Matt Mackall
c1213eaf9d commit: drop the now-unused files parameter 2009-06-01 14:11:32 -05:00
Matt Mackall
914f8e938d tag: use match.exact for commit 2009-06-01 14:11:19 -05:00
Matt Mackall
6be7863a0e commands: drop files arg for commit calls 2009-06-01 13:51:21 -05:00
Matt Mackall
c22dd49465 commit: apply force flag without files 2009-06-01 13:51:21 -05:00
Marco Beck
47e33d1f81 templater: retain author's full name if no email is supplied (issue1685) 2009-06-03 14:50:03 +02:00
John Mulligan
3f2923090d heads: show closed heads only when --closed is passed
Add a --closed (-c) option to 'hg heads' to show all heads and change the
default behavior to refrain from showing fully closed branches.

Enhance 'hg heads <branch>' so that:

* default: displays normal & inactive heads, not closed heads
* --closed: displays normal, inactive & closed heads
* --active: displays only normal heads
* both --closed and --active: displays normal & closed heads only
2009-06-03 13:59:38 +02:00
John Mulligan
e094244749 localrepo: set heads and branchheads to be closed=False by default
The heads(...) and branchheads(...) functions will now only return closed
heads when explicitly asked for them. This will cause 'hg merge' to have
better behavior in the presence of a branch that has closed heads when no
explicit rev is passed.
2009-06-03 13:42:55 +02:00
Matt Mackall
ac02180873 match: fold plan cases down to two special cases
- merge always and match with patterns
- make always and match with patterns the default
- invert dostep3 to skipstep3
- move dirignore test inside exact case
2009-05-31 17:54:18 -05:00
Matt Mackall
fdab704ebc walk: refactor walk plan
- never is gone
- reorder tests more cleanly
- rename nomatches to exact for clearer semantics
2009-05-31 17:54:18 -05:00
Matt Mackall
e802acf0e9 match: remove match.never
Only one user, can be translated to match.exact()
2009-05-31 17:54:18 -05:00
Matt Mackall
9c7c16f5cf walk: use match.bad callback for filetype messages 2009-05-31 17:54:18 -05:00
Matt Mackall
37eaadf540 match: ignore return of match.bad
All users returned false, return can now be dropped
2009-05-31 17:54:18 -05:00
Matt Mackall
e81e064b9c add: use match.bad callback more effectively 2009-05-31 17:54:18 -05:00
Matt Mackall
2940d96bce match: document bad callback semantics 2009-05-31 17:54:18 -05:00
Matt Mackall
7c83618e4d walk: simplify logic for badfn clause
- matchfn redundant
- call badfn always rather than fwarn
- use for/else rather than keep var
2009-05-31 17:54:18 -05:00
Matt Mackall
2e3801b37e walk: we always have a badfn 2009-05-31 17:54:18 -05:00
Matt Mackall
6275c6f6e2 walk: simplify check for missing file 2009-05-31 17:54:18 -05:00
Martin Geisler
5a71040932 commands: typo in bundle abort message
This error trigger if one calls bundle with the wrong parameters and
it is thus not an error scripts will want to look for (they could and
should ensure that they call bundle with the correct parameters).
2009-05-31 18:09:19 +02:00
Martin Geisler
c624e91552 fixed typos found in translatable strings
This is from a spell-check of hg.pot.
2009-05-31 14:55:51 +02:00
Martin Geisler
fabd4ae1de commands: expand "arg" -> "argument" in showconfig help strings
It is easier to translate full sentences without abbreviations, or
said differently, I don't know a short Danish word for "argument".
2009-05-31 14:48:17 +02:00
Martin Geisler
3f7c86dc69 wrap string literals in error messages 2009-05-31 01:30:16 +02:00
Martin Geisler
7fc350327e revlog: make triple-quoted string a real comment 2009-05-31 00:58:20 +02:00
Martin Geisler
cac71647b1 posix: do not use fstat in isowner
The fstat function was undefined, but never used since a stat object
was always passed in the optional st argument. Passing st is now
mandatory.

This bug crept in when util was split up into posix and windows
modules. The fstat function is still defined in util, but importing it
into posix would create an import cycle which seems unnecessary.
2009-05-30 23:42:35 +02:00
Martin Geisler
58e8fb6277 removed unused imports 2009-05-30 23:20:30 +02:00
Brendan Cully
5189b36798 Move alias into core 2009-05-30 11:32:23 -07:00
Matt Mackall
28a532efb7 revlog: refactor chunk cache interface again
- chunk to _chunk
- _prime to _chunkraw
- _chunkclear for cache clearing
- _chunk calls _chunkraw
- clean up _prime a bit
- simplify users in revision and checkinlinesize
- drop file descriptor passing (we're better off opening fds lazily
2009-05-27 16:01:34 -05:00
Benoit Boissinot
13b1ecd60e clone: fall back to pull source repo cannot be locked, 039087cb3900 was a noop
039087cb3900 was a noop, it was missing the wait keyword
2009-05-28 17:44:57 +02:00
Adrian Buehlmann
7a0533d1fa localrepo: move comment 2009-05-28 08:29:40 +02:00
Simon Heimberg
1d6b2ca034 localrepo: use lock.release for single lock 2009-05-27 14:16:13 +02:00
Martin Geisler
09d5799bbb dirstate: fixed typo in comment 2009-05-27 23:39:41 +02:00
Matt Mackall
23a569538b changelog: make delayopener less intrusive 2009-05-27 14:44:55 -05:00
Matt Mackall
4dc9e4309d revlog: report indexfile rather than datafile for integrity check 2009-05-27 14:44:54 -05:00
Matt Mackall
07ba4cbe2d ui: fix two bugs in %% warning 2009-05-27 14:44:52 -05:00
Matt Mackall
df215f1dab revlog: move stat inside lazyparser 2009-05-27 14:44:51 -05:00
Matt Mackall
66cde5c7cb dirstate: notice truncated parents read 2009-05-25 12:48:15 -05:00
Matt Mackall
1c30179455 lookup: check for dirstate damage on failure 2009-05-25 10:44:37 -05:00
Peter Arrenbrecht
7faf52b00f merge: whitespace cleanup 2009-05-27 16:25:31 +02:00
Benoit Boissinot
1d46ec6dc3 changegroup: the node list might be an empty generator (fix issue1678) 2009-05-27 02:46:59 +02:00
Benoit Boissinot
d81f680b31 store encoding: .i/.d encoding for non-store repo (broken by 67e6074ba430) 2009-05-26 23:49:53 +02:00
Martin Geisler
5b4e5428df replace "i in range(len(xs))" with "i, x in enumerate(xs)"
The remaining occurrences should be the ones where "xs" is mutated or
where "i" is used for index arithmetic.
2009-05-26 22:59:52 +02:00
Martin Geisler
d8ad0f17b4 util: simplify range expression
The n index variable was unused. Every iteration would pop one element
off of parts, so the for loop can be replaced with a while loop.
2009-05-26 22:37:26 +02:00
Martin Geisler
4176f5b789 replace xrange(0, n) with xrange(n) 2009-05-25 23:06:11 +02:00
Dirkjan Ochtman
e4b1a0608c hgweb: extract config values after reading webdir-config 2009-05-26 10:16:17 +02:00
Benoit Boissinot
d861db9be5 revlog: fix undefined variable introduced in 042cecef3ad7 2009-05-25 13:52:09 +02:00
Martin Geisler
d6db5e0057 use ui instead of repo.ui when the former is in scope 2009-05-24 22:37:20 +02:00
Matt Mackall
a30eb02911 cmdutils: Take over glob expansion duties from util 2009-05-24 16:38:29 -05:00
Matt Mackall
bd7c2104ff match: fix _patsplit breakage with drive letters 2009-05-24 16:37:34 -05:00
Patrick Mezard
945857d352 statichttprepo: handle remote not supporting Range headers
- If remote does not support Range header, 200 is answered instead of 206. The
  HTTPRangeHandler left these responses unchanged, so the data has to be sliced
  by the receiver.
- httprangereader file pointer was not updated.
2009-05-24 18:31:01 +02:00
Patrick Mezard
1e0e3ba6d6 hgwebdir: fix [collections] evaluation under Windows
Virtual and real path separators are not the same under Windows.
2009-05-21 20:32:45 +02:00
Patrick Mezard
c51f73163e osutil: silence uninitialized variable warning 2009-05-24 16:27:50 +02:00
FUJIWARA Katsunori
0c065c08fa compare grep result between target and its parent
I found that typical case is that grep target is added at (*) revision
in the tree shown below.

     +--- 1(*) --- 3
     0
     +--- 2 ------ 4

Now, I expect 'hg grep --all' to show only rev:1 which is first
appearance of target line.

But 'hg grep --all' will tell:

  target line dis-appeared at 3 => 4
  target line     appeared at 2 => 3
  target line dis-appeared at 1 => 2
  target line     appeared at 0 => 1

because current 'hg grep' implementation compares not between target
revision and its parent, but between neighbor revisions in walkthrough
order.

I checked performance of this patch by "hg grep --follow --all
walkchangerevs" on whole Mercurial repo, and patched version could
complete as fast as un-patched one.
2009-05-19 16:49:54 +09:00
Henrik Stuart
eb1e0babd5 url: let host port take precedence when connecting to HTTPS
Fixes use of HTTPS connections on non-standard ports.
2009-06-20 17:09:49 +02:00
Henrik Stuart
972f154635 url: support client certificate files over HTTPS (issue643)
This extends the httpshandler with the means to utilise the auth
section to provide it with a PEM encoded certificate key file and
certificate chain file. This works also with sites that both require
client certificate authentication and basic or digest password
authentication, although the latter situation may require the user to
enter the PEM password multiple times.
2009-06-20 10:58:57 +02:00
Henrik Stuart
b843569ec5 acl: support for getting authenticated user from web server (issue298)
Previously, the acl extension just read the current system user, which
is fine for direct file system access and SSH, but will not work for
HTTP(S) as that would return the web server process user identity
rather than the authenticated user. An empty user is returned if the
user is not authenticated.
2009-06-07 20:31:38 +02:00
Henrik Stuart
45e3728174 hgweb: escape REMOTE_HOST when passing url for addchangegroup
If DNS lookups are turned off on the web server, REMOTE_HOST may be
populated with REMOTE_ADDR, which, if the remote is an IPv6 hosts will
contain colons, thus interfering with the separator character. This is
solved by URL quoting the REMOTE_HOST string.
2009-06-07 20:15:37 +02:00
Dirkjan Ochtman
605b944edf kill trailing whitespace 2009-06-19 13:47:50 +02:00
Peter Arrenbrecht
fd55ac9c4d graphmod/webcommands: use generic DAG walks
Changes graph() to colorededges(), which operates on the new
generic DAG walks and adds color and edge information needed
by the web graph.

This is in preparation of adding DAG walk filters, like the
linear run collapser in the next patch. The idea is to have
a bunch of changelog walkers that return basic data. Then we
can filter this data. Finally we add edge and formatting info
suitable for the output media we want to target (glog, hgweb).
2009-06-19 13:44:23 +02:00
Henrik Stuart
01c54d72e3 templatefilters: add filter to convert date to local date (issue1674)
Issue1674 suggests the localdate filter be applied as default to log,
but this patch only introduces the filter, not the changed default
behaviour.
2009-05-24 11:41:07 +02:00
Henrik Stuart
a79a5a1a15 url: use CONNECT for HTTPS connections through HTTP proxy (issue967)
urllib2 and httplib does not support using CONNECT proxy requests, but
only regular requests over the proxy. This does not work with HTTPS
requests as they typically require that the client issues a CONNECT to
the proxy to give a direct connection to the remote HTTPS server.

This is solved by duplicating some of the httplib functionality and
tying it together with the keepalive library such that a HTTPS
connection that need to be proxied can be proxied by letting a
connection be established to the proxy server and then subsequently
performing the normal request to the specified server through the
proxy server.

As it stands, the code also purports to support HTTPS proxies, i.e.
proxies that you connect to using SSL. These are extremely rare and
nothing is done to ensure that CONNECT requests can be made to these
as that would require multiple SSL handshakes. This use case is also
not supported by most other contemporary web tools like curl and
Firefox3.
2009-05-22 08:56:43 +02:00
Martin Geisler
fc8a97dac3 changelog: refuse to add revisions with empty usernames
An empty username or a username with a "\n" will make the revision
text contain two "\n\n" sequences -> corrupt repository.

The problem is that changelog.read expects to find exactly one "\n\n"
separator and thus cannot unpack the revision.
2009-05-16 11:12:49 +02:00
Peter Arrenbrecht
5eb219567b graphmod: rename a bunch of vars in graph() 2009-05-16 07:12:12 +02:00
Peter Arrenbrecht
e798ecda43 graphmod/graphlog: make dag walks carry data as type, payload 2009-06-19 13:22:32 +02:00
Peter Arrenbrecht
4f16f2b978 graphmod/graphlog: extract nodelistwalk 2009-06-19 13:14:45 +02:00
Peter Arrenbrecht
6b4a9cc835 graphmod/graphlog: move log walks to graphmod 2009-06-19 13:14:01 +02:00
Martin Geisler
aed75cf65f util: import random, missing since 5c703a28d882 2009-05-14 22:59:12 +02:00
Simon Heimberg
4b2cc385e8 dirstate: skip step 3 in walk if nothing new will match
nothing will ever match on match.never
nothing new will match on match.exact (all found in step 1)
nothing new will match on match.match when
  there is no pattern and
  there is no direcory in pats
2009-05-14 19:54:26 +02:00
Peter Arrenbrecht
46c6deb9d6 graphmod: code cleanup and doc fix 2009-05-14 17:32:31 +02:00
Dirkjan Ochtman
7daf0cc9cd merge: rename -S/--show option to -P/--preview 2009-06-19 13:58:48 +02:00
Simon Heimberg
3a8453f88a dirstate: set more states in step 1 of walk 2009-05-14 10:50:45 +02:00
Matt Mackall
f1416e098e match: fold match into _match base class 2009-05-24 02:56:22 -05:00
Matt Mackall
50be99f7cb match: add exact flag to match() to unify all match forms 2009-05-24 02:56:20 -05:00
Matt Mackall
e8c6616c42 match: redefine always and never in terms of match and exact 2009-05-24 02:56:14 -05:00
Matt Mackall
dad8161beb match: fold _globprefix into _roots 2009-05-24 02:56:14 -05:00
Matt Mackall
870bafcadb match: optimize escaping in _globre
- localize re.escape
- fastpath escaping of non-special characters
2009-05-24 02:56:14 -05:00
Matt Mackall
fb6d5f4ec6 match: remove head and tail args from _globre 2009-05-24 02:56:14 -05:00
Matt Mackall
6cec04c6af match: fold _matcher into match.__init__ 2009-05-24 02:56:14 -05:00