Commit Graph

4449 Commits

Author SHA1 Message Date
Patrick Mezard
b023997f48 patch: pass an opener to patchfile 2008-11-19 13:27:57 +01:00
Patrick Mezard
80b7eb3c69 util_win32: implement posixfile_nt.readlines() 2008-11-18 13:20:55 +01:00
Patrick Mezard
c7c4e521be patch: remove useless unlink() call 2008-11-19 13:27:57 +01:00
Matt Mackall
076f93ace1 hgweb: Change default style to paper 2008-11-06 11:56:01 -06:00
Mark Edgington
bf5852441b hgweb: support for deny_read/allow_read options
reimplementation of a patch provided by Nilton Volpato.

Folded into a single patch by Thomas Arendsen Hein.
2008-10-31 15:28:06 +01:00
Benoit Boissinot
becc8b09ae add missing import from d329ec89ce55 2008-11-07 18:42:43 +01:00
Benoit Boissinot
a95f4bd10d fix restart of interrupted recover
Ignore missing files if they are already removed.
Thanks maelcum on IRC for reporting it.
2008-11-07 18:41:22 +01:00
Dirkjan Ochtman
a0fd77cd87 hgweb: fix pagination for graph 2008-11-07 15:40:36 +01:00
Thomas Arendsen Hein
9ef29ab028 Enhance gitdiffs help text 2008-11-07 13:02:03 +01:00
Peter Arrenbrecht
63d1bb911f ui: log non-interactive default response to stdout when verbose
This allows test scripts that feed their output into documentation
to properly show the session as it would appear to an end-user.
2008-11-07 10:27:39 +01:00
Ronny Pfannschmidt
599e773be7 export: fixed silent output file overwriting
hg export -o outfile 1 2 3 4 had the same effect as hg -o outfile 4

This was caused by opening with 'w' instead of 'a'. This only occurs when
the filename pattern resulted in ambiguous patch filenames.
2008-11-06 11:17:38 +01:00
Dirkjan Ochtman
9cd425cc1b hgweb: move another utility function into the webutil module 2008-11-03 20:31:53 +01:00
Dirkjan Ochtman
5e743c6696 hgweb: move the diffs() generator into webutil 2008-11-03 20:41:48 +01:00
Dirkjan Ochtman
17464b3066 hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
This gets us git diffs when enabled and doesn't pick erratic file parents.
2008-11-03 20:05:03 +01:00
Dirkjan Ochtman
2f6d26d640 patch: turn patch.diff() into a generator
This should even be a little faster than passing in an fp argument.
2008-11-03 16:48:23 +01:00
Dirkjan Ochtman
4af26a1f84 help: commands supporting --git point to the gitdiffs topic (issue1352) 2008-11-03 16:31:47 +01:00
Ry4an Brase
555314efe8 hgweb: descend empty directories in web view
When a manifest has a series of directories with nothing in them but a single
directory, displaying the entire chain of empty directories allows for
navigation down to the first non-empty directory with a single click.

Because Java links package hierarchy to directory hierarchy, and because Java
conventions include at least three empty directories at the top of this
hierarchy, descending down empty directories is very common in Java web tools.
2008-11-03 10:20:28 +01:00
Thomas Arendsen Hein
b365acf675 Corrected some command synopsises 2008-11-02 17:28:03 +01:00
Patrick Mezard
2e3aa68a1d Fix util._statfiles_clustered() failing at root of a windows drive
Report and initial fix by Andrei Vermel <avermel@mail.ru>.
2008-11-01 15:15:14 +03:00
Dirkjan Ochtman
1450b6c29e hgweb: conditionally show file logs for deleted files 2008-11-01 13:07:24 +01:00
Dirkjan Ochtman
604b2a1406 kill some trailing spaces 2008-11-01 13:06:36 +01:00
Dirkjan Ochtman
3708bb4a03 hgweb: pass more information about parent/child csets to templates 2008-10-30 09:46:45 +01:00
Dirkjan Ochtman
4a5e2178e2 help: add a topic on git diffs (issue1352) 2008-10-30 08:21:20 +01:00
Brendan Cully
03a69e59f7 Allow per-file shadowing of static directory in templatepath 2008-10-28 22:24:17 -07:00
Brendan Cully
795ad024bb hgweb: handle subdirectories within static directory 2008-10-28 21:58:30 -07:00
Patrick Mezard
1c11cefeaf url: detect scheme with a regexp instead of urlsplit()
The latter says 'c' is a scheme in 'c:\foo\bar'
2008-10-28 23:54:01 +01:00
Patrick Mezard
b5e6153e70 url: fix file:// URL handling 2008-10-28 22:24:41 +01:00
Benoit Boissinot
94f1c13ccd fix missing import, spotted by pychecker 2008-10-28 20:14:45 +01:00
Benoit Boissinot
ea7fe6dacc remove unused variables 2008-10-28 19:25:26 +01:00
Benoit Boissinot
2914e4c487 Fix https availability checking
thanks to Augie Fackler for noticing it.
2008-10-28 19:07:14 +01:00
Greg Ward
fe9096cb7d help: Refine a bit the help text of "hg update"
Parts of the original text were submitted by Hubert Kauker (Hubert
dot Kauker at travelbasys.de).  This is a slightly revised version
of Hubert's original text.
2008-10-27 13:38:31 -04:00
Benoit Boissinot
15ec41ce13 statichttprepo: cleanups, use url.py (proxy, password support)
- unify httprangereader.py and statichttprepo.py:rangegreader()
- build the opener from url.py, that allows use to puse username and password
  in the url, to follow the proxy settings from hgrc, etc.
2008-10-28 08:26:18 +01:00
Benoit Boissinot
b16c2d675b merge with crew 2008-10-28 00:03:28 +01:00
Patrick Mezard
98804940d3 patch: rewrite diffstat with util.filter()
Simpler and works under Windows.
2008-10-27 22:57:55 +01:00
Benoit Boissinot
311e4870b2 use our urlopener (proxy handling, etc) instead of urllib 2008-10-27 21:50:16 +01:00
Benoit Boissinot
214af7ec3c factor out the url handling from httprepo
Create url.py to handle all the url handling:
- proxy handling
- workaround various python bugs
- handle username/password embedded in the url
2008-10-27 21:50:01 +01:00
Benoit Boissinot
cd80319bc5 httprepo: factor out proxy handling 2008-10-27 17:48:05 +01:00
Patrick Mezard
ef4d9a9d32 patch: fix patched files records in externalpatcher() 2008-10-26 17:26:28 +01:00
Bartosz SKOWRON
6ad08c06ee patch: remove double variables in copyfile() func 2008-10-24 20:46:56 +02:00
Benoit Boissinot
566c5d9e55 findincoming: build the correct list from the start 2008-10-24 16:20:53 +02:00
Thomas Arendsen Hein
912f59bb30 Remove trailing spaces. 2008-10-24 15:00:40 +02:00
Adrian Buehlmann
42f1fb6f03 add format.usefncache config option (default is true)
This enables for example "hg clone --config format.usefncache=0" which
creates a non-fncache repository, which then can be read by Mercurial
versions before 74698d160f52.
2008-10-24 10:31:51 +02:00
Benoit Boissinot
4f2e35bc33 fix pull racing with push/commit (issue1320)
changegroup() has a problem when nodes which does not descend from a node
in <bases> are added to remote after the discovery phase.
If that happens, changegroup() won't send the correct set of nodes, ie.
some nodes will be missing.
To correct it we have to find the set of nodes that both remote and self
have (called <common>), and send all the nodes not in <common>.

This fix has some overhead, in the worst case it will re-send a whole branch.

A proper fix to avoid this overhead might be to change the protocol so that
the <common> nodes are sent (instead of the <bases> of the missing nodes).
2008-10-21 17:00:35 +02:00
Matt Mackall
233bc0e342 grep: avoid infinite loop when trailing newline is missing 2008-10-23 14:56:16 -05:00
Adrian Buehlmann
f3f0f9ecd6 introduce fncache repository layout
* adds a new entry 'fncache' to '.hg/requires' for new repos
* writes new file '.hg/store/fncache'
* hash-encodes filenames with long paths (issue839)
* encodes Windows reserved filenames (issue793)
2008-10-19 19:12:07 +02:00
Alexander Solovyov
3aa9ebf062 bisect with command: ability to skip revision or abort bisection 2008-10-16 19:40:09 +03:00
Alexander Solovyov
df3cbc6026 bisect: ability to check revision with command 2008-10-10 16:58:14 +03:00
Mads Kiilerich
156ce431aa Make it possible to disable filtering for a pattern.
Rationale: Apparently there were no way to disable for example win32text extension locally.

RFC: Can it already be done another way?
2008-10-14 21:28:49 +02:00
Martin Geisler
da335e4675 i18n: import _ instead of gettext 2008-10-21 17:47:49 +02:00
Thomas Arendsen Hein
ba25030ab6 Minor cleanup: Add missing space forgotten in recent change. 2008-10-23 19:27:25 +02:00
Matt Mackall
26ddb1a665 extensions: add wrapping functions 2008-10-22 17:34:50 -05:00
Matt Mackall
bebeb261d5 findcmd: have dispatch look up strict flag 2008-10-22 17:34:08 -05:00
Matt Mackall
7776242f94 imported patch filteruser.patch 2008-10-22 17:00:05 -05:00
Matt Mackall
e617903e64 Autodetect static-http 2008-10-22 15:41:32 -05:00
Matt Mackall
ee921a6080 help: update help
make help description 'topic'-oriented rather than 'command'-oriented
change 'special' to 'additional'
2008-10-22 14:30:34 -05:00
Matt Mackall
6c908ebf9b chmod -x simplemerge.py 2008-10-22 13:05:40 -05:00
Benoit Boissinot
8b4d17702e findincoming: do the binary search in branches in parallel 2008-10-22 21:43:35 +02:00
Benoit Boissinot
d4f73288f1 protocol/between: the protocol expects to have ' '-separated tuples 2008-10-22 21:41:57 +02:00
Thomas Arendsen Hein
712c41183e Remove trailing space 2008-10-22 18:55:07 +02:00
Benoit Allard
31ab3aeaed hgwebdir: show nested repositories (issue1336) 2008-10-22 18:23:32 +02:00
Dirkjan Ochtman
7c9e09c95d patch/diff: use a separate function to write the first line of a file diff 2008-10-22 13:14:52 +02:00
Dirkjan Ochtman
78076ceffb patch: consolidate two different regexes for parsing of git diffs 2008-10-22 12:56:28 +02:00
Dirkjan Ochtman
fd4600fc66 patch: extract local function addmodehdr 2008-10-22 09:29:26 +02:00
Dirkjan Ochtman
896a6939aa help: show extension commands in short list, separate extension list in help
In 'hg', we now show a short list of commands, including extension commands.
In 'hg help', we show core commands, a list of enabled extensions, and topics.
2008-10-21 11:29:27 +02:00
Dirkjan Ochtman
12d9da5e35 help: show help topics by default in 'hg help', with longest available id 2008-10-21 11:05:45 +02:00
Christian Ebert
e8342a5b19 mail: correct typo in variable name 2008-10-21 10:29:57 +02:00
Thomas Arendsen Hein
614711f636 merge with crew 2008-10-20 18:29:44 +02:00
Christian Ebert
febc2f8f3c mail: mime-encode patches that are utf-8
utf-8 can be safely detected without making assumptions on the
encoding/locale used by the recipient.

Content-Transfer-Encoding for utf-8 patches is base64 (default of
python's email module).
2008-10-20 17:40:29 +02:00
Thomas Arendsen Hein
8999e196bc Some additional space/tab cleanups 2008-10-20 15:19:05 +02:00
Dirkjan Ochtman
1c96ed002e merge with crew-stable, again 2008-10-20 14:58:49 +02:00
Dirkjan Ochtman
f73840b37b merge with crew-stable 2008-10-20 14:57:56 +02:00
Dirkjan Ochtman
f5ea74b223 clean up trailing spaces, leading spaces in C 2008-10-20 14:57:04 +02:00
Thomas Arendsen Hein
380f8d8da9 spaces->tabs in one line of a C extension for consistency 2008-10-20 14:53:53 +02:00
Dirkjan Ochtman
664ef048a7 merge with crew-stable 2008-10-20 14:52:58 +02:00
Dirkjan Ochtman
e085823cf1 clean up trailing spaces 2008-10-20 14:51:55 +02:00
Dirkjan Ochtman
cc867a892e hgweb: working diff for removed files 2008-10-20 14:13:37 +02:00
Dirkjan Ochtman
3bcd8d8cc6 hgweb: remove links to non-existent file versions 2008-10-20 12:41:09 +02:00
Dirkjan Ochtman
e7f8861527 hgweb: be sure to drain request data even in early error conditions
Thanks to Mads Kiilerich with noticing this. The hg client can only read data
after all the sent data has been read, so we have to read all the request data
even if we're not going to do anything with it (in error conditions). This
is not easy to fix in the client, because we're using Python's httplib, which
is strictly stateful. Abstracted the draining into a separate method.
2008-10-20 10:15:26 +02:00
Thomas Arendsen Hein
28f8d4bb8e merge with crew-stable 2008-10-19 22:07:43 +02:00
Thomas Arendsen Hein
94f908042c Fix Debian bug #494889 (fetching from static-http://... broken)
Changeset 055df4ac4b13 which fixed issue965 (hg clone static-http
does not work for empty repos) broke cloning of repos with old layout
(without store) via static-http.

This fix makes cloning from old-style repositories possible again,
but will not allow cloning of empty old-style repositories as this
can not be detected reliably.
2008-10-19 19:49:56 +02:00
Benoit Boissinot
bc6e674802 merge with crew 2008-10-19 20:29:41 +02:00
Benoit Boissinot
fdd2a14dd6 parsers.c: do not try to untrack after a failure 2008-10-19 20:17:06 +02:00
Benoit Boissinot
64b6a68b1b parsers.c: fix integer overflows
thanks to zzuf for helping finding those
2008-10-19 20:16:37 +02:00
Thomas Arendsen Hein
1493b09823 Merge with crew 2008-10-19 19:10:26 +02:00
Benoit Boissinot
0a350d3213 parsers.c: there is no reference to data_obj, so it shouldn't be decref'ed 2008-10-19 16:11:23 +02:00
Thomas Arendsen Hein
e5350e7597 Copy index before parsing to enforce alignment with inline data present.
Fixes issue1348 (Bus error in parsers.c) on Solaris/sparc.
2008-10-19 15:08:30 +02:00
Thomas Arendsen Hein
593bff360d Add util.popen3 fallback, simplify import of Popen3 2008-10-19 12:19:55 +02:00
Thomas Arendsen Hein
b7ce96daba Fix util.popen2 for Python 2.3
1. trigger ImportError early, so fallbacks are activated
2. util.popen2 replaces previous usage of os.popen2, not popen2.popen2
2008-10-19 12:13:25 +02:00
Benoit Boissinot
2a624d5e3d merge with crew 2008-10-19 01:29:57 +02:00
Benoit Boissinot
1abf8f679b index parser: fix refcounting in case of errors, refactor
due to incorrect refcounting, on a bad revlog it was failing with:
*** glibc detected *** /usr/bin/python: corrupted double-linked list: 0x0816d318 ***
and a backtrace.
2008-10-19 01:26:46 +02:00
Patrick Mezard
907514d367 patch: pass linereader to binaryhunk.extract() instead of wrapped fp
It unifies input patch file access methods
2008-10-18 23:45:46 +02:00
Patrick Mezard
7e769ebcae patch: pass linereader to scangitpatch(), extract from iterhunks()
It's good because it unifies the patch file access methods.
2008-10-18 23:45:46 +02:00
Patrick Mezard
92038e51fa patch: change functions definition order for readability 2008-10-18 23:45:45 +02:00
Patrick Mezard
3eb6564f0f patch: map changed files to patchmeta directly 2008-10-18 23:45:45 +02:00
Patrick Mezard
caa00c7b41 patch: patchmeta gives (islink, isexec) tuple instead of int mode 2008-10-18 23:45:45 +02:00
Patrick Mezard
5924883bb6 patch: extract and rename gitpatch into patchmeta, document 2008-10-18 23:45:45 +02:00
Patrick Mezard
d76f01041c patch: remove applydiff() useless updatedir and rejmerge arguments 2008-10-18 23:45:45 +02:00
John Mulligan
636223becf issue 1144: prevent traceback on verify of bundles 2008-10-18 14:43:14 -04:00
Patrick Mezard
45970973da util: handle EINVAL in _statfiles_clustered()
Raised when osutil.listdir is called on a non-directory entry.
2008-10-18 20:50:08 +02:00
Brendan Cully
44b5949ce4 _listdir only uses dfd if AT_SYMLINK_NOFOLLOW is defined 2008-10-18 11:43:45 -07:00
Benoit Boissinot
d3445ca0d4 merge with crew 2008-10-18 20:39:08 +02:00
Benoit Boissinot
3ef88afae1 fix issue with strip() for revlog with non-monotonic linkrevs (issue1342)
extra nodes should always be included, do the call after the pruning
2008-10-18 20:25:45 +02:00
Benoit Boissinot
6de97a000b revlog parser: use ntohl() instead of ntohll() (fix endianness issues) 2008-10-18 20:23:46 +02:00
Alexander Solovyov
ab302e7705 commands: optional options where possible
This makes life a lot easier on API users.
2008-10-18 18:05:56 +02:00
Dirkjan Ochtman
371218cc63 get rid of semi-colon introduced in 89c0afc2016a 2008-10-18 16:30:50 +02:00
Matt Mackall
d06459495e rename: handle renaming to a target marked removed 2008-10-18 04:26:09 -05:00
Matt Mackall
4eb3a715b4 dirstate: always add times to map as integers
Fix bug spotted by Dov Feldstern
2008-10-18 04:26:06 -05:00
Patrick Mezard
0107794fd2 convert: tolerate embedded spaces in filemap source revisions 2008-10-10 11:32:38 +02:00
Petr Kodl
681e2c1a41 Take advantage of fstat calls clustering per directory if OS support it.
util module implements two versions of statfiles function

_statfiles calls lstat per file

_statfiles_clustered takes advantage of optimizations in osutil.c, stats all
files in directory at once when new directory is hit and caches the results

util.statfiles dispatches to appropriate version during module loading

The speedup on directory tree with 2k directories and 63k files is about
factor of 1.8 (1.3s -> 0.8s for hg diff - hg startup overhead about .2s)

At this point only Win32 now benefit from this patch.
Rest of OSes use the non clustered implementation.
2008-10-09 10:29:47 -04:00
Bernhard Leiner
f1a8298e61 Add missing catch of a TypeError 2008-10-03 23:13:03 +02:00
Dirkjan Ochtman
fcf19417f1 clone: honor -r even when pulling named branches 2008-09-24 13:10:09 +02:00
Benoit Boissinot
0d1cd8705f Escape '%' when writing to hgrc (issue1199)
Fixes clone with paths containing '%'.
Patch provided by mjc.
2008-09-20 15:00:58 +02:00
Martin Geisler
c6e4e2012e update: mention null revision in help text 2008-09-17 10:24:30 +02:00
Scott McCreary
501e6fe68f allow Mercurial to compile on Haiku 2008-09-17 10:22:35 +02:00
Benoit Boissinot
d6add1b5a8 forbid username with '\n' at the changelog level
It was already forbidden for ui.username() but no verification were
made for username passed through the commandline.
2008-09-13 17:46:09 +02:00
Benoit Boissinot
0833f4e74b osutil: proper error checking and reporting 2008-09-10 22:37:07 +02:00
Benoit Boissinot
d179cdfe82 a socket error might be a tuple or a singleton 2008-09-06 00:45:13 +02:00
Dirkjan Ochtman
f785a1c716 bisect: only complain when nothing can be done 2008-09-03 19:00:43 +02:00
Dirkjan Ochtman
83b9ec89ae bisect: status message when no action is specified 2008-08-21 19:02:56 +02:00
Dirkjan Ochtman
0e4ee54eec bisect: expand help text to explain REV argument and --noupdate 2008-08-21 19:02:46 +02:00
Remy Roy
1ec1bfb70c Folding correction and missing import 2008-08-12 10:05:00 -04:00
Matt Mackall
59a536d380 util: disinfect lookup_reg strings (issue1126)
lookup_reg could return Unicode strings, which would infect other strings and
generate unexpected tracebacks. Spotted by Rémy Roy.

Fold in silly nested function while we're at it.
2008-08-10 22:55:00 -05:00
Matt Mackall
bfc02d4c70 util: set_flags should survive failure to create link 2008-08-10 21:55:23 -05:00
Matt Mackall
e03f4e2f73 util: set_flags shouldn't know about repo flag formats 2008-08-10 21:55:06 -05:00
Matt Mackall
4d074f2f87 add a fix for issue 1175
If we copy a file followed by an update, it's possible for the parent
manifest to no longer contain the source file of the copy, which could cause
commit to fail. If this happens, we search backwares from the first
parent to find the most likely original revision.
2008-08-10 18:01:03 -05:00
Matt Mackall
879e08f657 commit: simplify file copy logic 2008-08-10 18:01:03 -05:00
Bernhard Leiner
5e75dbce63 Add support for multiple possible bisect results (issue1228, issue1182)
The real reason for both issue is that bisect can not handle cases where there
are multiple possibilities for the result.

Example (from issue1228):
rev 0 -> good
rev 1 -> skipped
rev 2 -> skipped
rev 3 -> skipped
rev 4 -> bad

Note that this patch does not only fix the reported Assertion Error but also
the problem of a non converging bisect:

hg init
for i in `seq 3`; do echo $i > $i; hg add $i; hg ci -m$i; done
hg bisect -b 2
hg bisect -g 0
hg bisect -s

From this state on, you can:
 a) mark as bad forever (non converging!)
 b) mark as good to get an inconsistent state
 c) skip for the Assertion Error

Minor description and code edits by pmezard.
2008-08-02 22:10:10 +02:00
Benoit Boissinot
1fe456f76c hgweb: do not use unassigned variables in exception handling 2008-08-01 12:33:10 +02:00
Dirkjan Ochtman
1c8c354f87 add note about updating one file to update help 2008-07-25 13:26:16 +02:00
Benoit Boissinot
9d636a4b09 make mq and tags hardlink safe
The code didn't check for modes like "r+" or "rb+".
Many thanks to agriffis for noticing it.
2008-07-23 16:08:20 +02:00
Stefano Tortarolo
a91f0242e8 branches unparseable output fix (issue1230) 2008-07-20 12:09:37 +02:00
Christian Ebert
1d544eec15 mail: add methods to handle non-ascii chars
- headencode, addressencode: encode headers
- mimeencode: encode message parts not containing patches
- new email config "charsets"

Users may configure email.charsets as a list of charsets they
consider appropriate for the recipients of their outgoing mails.

Conversion is tried in this order:
1. us-ascii
   (ascii, us-ascii are removed from email.charsets if present)
2. email.charsets (if present) in order given
3. util._fallbackencoding, util._encoding, utf-8
   if not already in email.charsets
2008-07-12 19:11:59 +01:00
Bernhard Leiner
b7e7ab32c3 use the new parseindex implementation C in parsers 2008-10-17 00:24:22 +02:00
Bernhard Leiner
7989d67052 C implementation of revlog index parsing 2008-10-17 01:03:38 +02:00
Brendan Cully
34868ca5be Allow hgweb to search for templates in more than one path.
This patch is constructed to make it easy for external extensions to
provide their own templates, by updating templater.path.
2008-10-17 11:34:31 -07:00
Dirkjan Ochtman
67bd09df5b python2.6: use subprocess if available 2008-10-05 21:35:26 +02:00
Benoit Boissinot
d6688cc959 bdiff: normalize the diff (issue1295)
When the common part of a diff can be moved forward, move it forward.
Otherwise we don't get deterministic results (it would depends on the way we
split for the recursion).
That way we get identical hunks when doing the same change, it helps to solve
issue1295 (inconsistent diffs on different side during a merge).
2008-10-14 20:13:53 +02:00
Benoit Boissinot
91038026cf hgweb: cleanup the manifest generation 2008-10-15 21:50:47 +02:00
Benoit Boissinot
1d33f1c63b dirstate.walk: skip unreadable directories (issue1213)
Do not abort on permission denied error, just skip the directory.
2008-10-15 14:52:27 +02:00
Benoit Boissinot
1c8e168451 osutil.c: refactor argument parsing, allow skip=None being passed 2008-10-15 14:06:46 +02:00
Benoit Boissinot
45680829ac dirstate._dirs: fix refcounting broken by ece124266b74
reported by Patrick Waugh
2008-10-15 01:14:29 +02:00
Matt Mackall
60cd869653 annotate: fix bug when annotating multiple files 2008-10-12 19:21:07 -05:00
Matt Mackall
1c5fcf7d0e dirstate: C parsing extension 2008-10-12 15:21:08 -05:00
Matt Mackall
b98e1b895d parsers: speed up hex decoding for manifests 2008-10-12 15:21:08 -05:00
Matt Mackall
9124c02fed parsers: clean up whitespace 2008-10-12 15:21:08 -05:00
Matt Mackall
d8fdfa3f85 diff: pass contexts to status
Allow status() to take contexts as well as nodes. This lets us avoid
unpacking manifests multiple times and intelligently unpack manifests
in revision order. Also, we can avoid unpacking manifests at all when
there are no changes in the working directory.
2008-10-12 15:21:08 -05:00
Matt Mackall
a1af556eb5 revlog: fix heads performance regression 2008-10-12 15:21:08 -05:00
Patrick Mezard
ad3b5c4ec9 context: improve memctx documentation 2008-10-11 13:07:29 +02:00
Patrick Mezard
f8f73e46ef Merge with crew-stable 2008-10-10 13:20:40 +02:00
Patrick Mezard
e8a232c5c8 Show added files as "added" in editor commit message (issue 1330) 2008-10-09 14:16:17 +02:00
Petr Kodl
f41fa5275a Eliminate normpath from foldmap calls.
Normcase already takes care of upper/lower case and /->\ conversions.

What's left for normpath is folding of a/../a sequences but this should
be either done consistently on both non-folding and folding code path
or not at all, otherwise we are introducing inconsistent behavior between the
two that has nothing to do with case folding.

Second argument against it - normpath being pure Python function is very slow -
as much as 50% of time is spend just inside normpath call on my repository.
2008-09-30 17:23:08 -04:00
Petr Kodl
6dacfe6beb issue 1286: dirstat regression on case folding systems
This patch fixes regression reported in 1286 that causes util.fspath
to be called for every file not in current manifest - including ignored files.
The regression is quite severe - the time for simple hg st goes from 5s to 1m38s
on one of my source trees - which basically renders mercurial useless.
2008-09-30 17:23:08 -04:00
Matt Mackall
11fc6ebc37 status: don't warn about missing files present in base revision (issue1323) 2008-10-08 16:22:10 -05:00
Matt Mackall
48ebb7a1ba merge: fix bug going backwards for already reverted files (issue1303) 2008-10-08 16:22:08 -05:00
Patrick Mezard
ddd1cf2de8 Merge with crew-stable 2008-10-06 13:51:36 +02:00
Sune Foldager
9b5eac039b provide nicer feedback when an unknown node id is passed to a command
Previously, an unknown node id would lead to the following error:
abort: 00changelog.i@343445453433: no node!

All other unknown revision would instead display as:
abort: unknown revision '343445453'!

The former error message has been suppressed in favor of the latter.
2008-10-04 10:14:39 +02:00
Petr Kodl
6d8f8227f9 Improve error handling in osutil.c
1) In posix part set error when path is too long so instead of

SystemError: error returned without exception set

it will raise

ValueError: path too long

2) In Win32 part replace generic

PyErr_SetExcFromWindowsErrWithFilename

by

PyErr_SetFromWindowsErrWithFilename

The exception returned is WinError(based on OSError) and
some rudimentary errno translation is performed from Windows error range
to errno module friendly range so errors like ENOENT can be handled via symbolic
constant and consistently between Win32 and Posix.
2008-10-01 08:41:18 -04:00
Benoit Boissinot
0d962b79e7 fix conflicting variables when no native osutil is available
thanks weijun for the bug report and patch, fix issue1309
2008-09-29 11:57:27 +02:00
Petr Kodl
09cc67de2c osutil: implementation for Win32
Use information provided by FindFile... Win32 calls
to generate stat information without lstat call per file.
rwx bits in st_mode are ignored as they are not stored in Win32 fs
and Mercurial does not use them
Unicode path / path names over _MAX_PATH are intentionally not supported.
2008-09-14 09:57:33 -04:00
Dirkjan Ochtman
ba6b67f951 merge with crew-stable 2008-09-24 13:50:29 +02:00
Benoit Boissinot
66c79ea6b0 merge with -stable 2008-09-22 14:47:21 +02:00
Dirkjan Ochtman
0aa08a7ed8 merge with crew-stable 2008-09-17 11:34:37 +02:00
Matt Mackall
2d47031d0d listdir: add support for aborting if a certain path is found
This lets us bail out early if we find '.hg', letting us skip sorting
and bisecting for it.
2008-09-13 10:46:47 -05:00
Matt Mackall
c0ccecefce osutil: fix some braindamage
- entkind returns -1 on failure
- compile if AT_SYMLINK_NOFOLLOW is missing
- avoid fullpath overflow
2008-09-13 10:44:44 -05:00
Matt Mackall
7ce9a41a12 dirstate: improve performance for building _dirs 2008-09-12 19:57:07 -05:00
Matt Mackall
a1338aa911 osutil: major listdir cleanup 2008-09-12 15:11:02 -05:00
Dirkjan Ochtman
d372202ca2 hgweb: let the web graph cope with low revisions/new repositories (issue1293) 2008-09-12 16:15:01 +02:00
Rocco Rutte
f70a5a0f4e hgweb: Respond with HTTP 403 for disabled archive types instead of 404
This makes it easier for clients/users to distinct between supported
but disabled and unsupported archive types.
2008-09-05 17:28:37 +02:00
Benoit Boissinot
cdffbdce00 dirstate: use the right variable (f, not ff) 2008-09-10 22:54:28 +02:00
Benoit Boissinot
dd432a82af osutil: proper error checking and reporting 2008-09-10 22:37:07 +02:00
Benoit Boissinot
401371bd20 merge backout 2008-09-10 08:49:05 +02:00
Benoit Boissinot
f4db28e2cc Backed out changeset 1aa58165fc81 (see issue916 for details) 2008-09-10 08:48:23 +02:00
Martin Geisler
d247b977fd i18n: mark help strings for translation
The gettext function is just another name for the normal _ function
and it is used for translating docstrings when using _ would make
pygettext.py output a warning.
2008-09-09 21:32:39 +02:00
Martin Geisler
66070424fd restructure helptable
When looking up a help topic, the key is now only matched against the
short names for each topic, and not the header. So

  hg help 'Environment Variables'

must be replaced with

  hg help env
2008-09-09 21:32:39 +02:00
Benoit Boissinot
7ba2d57a89 Do not try to load extensions twice (issue811) 2008-09-09 14:43:12 +02:00
Benoit Boissinot
83c55610b6 enhance the error output in case of failure during http push 2008-09-08 14:22:14 +02:00
Benoit Boissinot
416e5f2ef9 tag: without a checkout, base the tag changeset on tip instead of nullid
issue916
2008-09-08 14:04:10 +02:00
Peter Ruibal
30a2036f9e use Exception(args)-style raising consistently (py3k compatibility) 2008-09-08 13:07:00 +02:00
Sune Foldager
20edf348ee branch: added more support for named branches
hg branch now has a -C (--clean) option, to reset the current (dirstate)
branch to the branch of the last commit (first parent).
2008-09-08 12:55:27 +02:00
Martin Geisler
ca8bba4890 do not pretend to lock static-http repositories (issue994) 2008-09-08 11:32:53 +02:00
Benoit Boissinot
1343a1f47c d5e923544dd7 uses err() instead of warn() but prototype doesn't match
we might want to make warn() look more like err() in the future
to avoid this kind of problem.
2008-09-08 00:50:34 +02:00
Martin Geisler
f13a644c2d i18n: mark command line for translation 2008-09-06 17:44:07 +02:00
Benoit Boissinot
ebcbcef11c merge with -stable 2008-09-06 17:04:01 +02:00
Patrick Mezard
f6efcddc6c store: pathjoiner default value is os.path.join 2008-09-05 11:00:07 +02:00
Adrian Buehlmann
d71509e706 Fix for Issue1260 2008-08-31 00:22:20 +02:00
Benoit Boissinot
5e411ee73c merge with crew 2008-09-05 10:39:19 +02:00
Benoit Boissinot
61cdb0bdd6 show extensions loaded on traceback 2008-09-05 10:00:57 +02:00
Dirkjan Ochtman
051db6ab82 merge with crew-stable 2008-09-03 19:03:57 +02:00
Rocco Rutte
fd3e1122b0 hgweb: Serve raw non-binary files as text/plain
Previously these were served as application/octet-stream usually making
browsers download them as files though they can be displayed inline just
fine. This is useful to refer to e.g. /project/raw-file/tip/README.
2008-09-03 15:46:46 +02:00
Benoit Boissinot
20fc9c8d79 allow committing a removed directory
fix issue1089
2008-09-03 02:27:25 +02:00
Benoit Boissinot
7f2ac71a6c make normalize() work when cwd != repo.root 2008-09-02 22:04:09 +02:00
Andrei Vermel
4812226d8b Fix normalize fail on non-lowercase filename (Issue1273)
regression introduced in 367ff9c9d221
2008-08-02 19:34:50 +04:00
Benoit Boissinot
882dcf0454 dirstate: explain why appending instead of os.path.join() is safe 2008-09-02 17:32:07 +02:00
Benoit Boissinot
fe44f90406 performance: normalize self._root, avoid calling os.path.join() in dirstate
In dirstate, self._join() might get called a lot. Instead of calling it
we create self._rootdir and we then only need to append the filename.
2008-09-02 15:12:50 +02:00
Benoit Boissinot
a835798d04 performance: do not stat() things when not required
Ignore unknown files if we don't need them (eg in hg diff).
It slows things down a little bit for big trees (kernel repo), since _join()
is called for each file instead of for each directory.

fix issue567
2008-09-02 15:08:26 +02:00
Martin Geisler
28fb695e9a i18n: mark strings for translation in Mercurial 2008-08-31 16:12:02 +02:00
Martin Geisler
897f1ddab8 i18n: avoid naive plural tricks 2008-08-31 16:12:02 +02:00
Dirkjan Ochtman
fcaabba3ec fix double indentation and trailing whitespace 2008-08-31 11:41:52 +02:00
Dirkjan Ochtman
0c1845ffb9 hgweb: return content iterator instead of using write() callable
This is a new version of b6b16fec2a60 (which was backed out in faf83e1e40f5),
with an extra line removed to fix problems with hg serve. hg's internal web
server contains checking if the app isn't trying to write more bytes than
specified by the Content-Length header. The first try still contained an old
line that wrote the response, so the response was sent twice.
2008-08-30 17:13:23 +02:00
Benoit Boissinot
5562ddda56 fix regression on empty repo cloning introduced by d87e43563bf4
The store directory wasn't copied. Unconditionally create the directories
instead.
2008-08-29 16:50:11 +02:00