Commit Graph

3375 Commits

Author SHA1 Message Date
Jim Hague
5ef18ea71f patch: fix sort() comparator argument
'hg import' fails under Python 2.3. The name of the compare function parameter in the call to list.sort() is 'cmpfunc' in Python 2.3 and
'cmp' in Python 2.4+. Passing the compare function as a named parameter is therefore problematic.
2007-11-25 11:49:34 +01:00
Alexis S. L. Carvalho
f8788ac266 httprepo: give self._url and the netloc to the password manager
This should hide some differences between different python versions.
2007-11-09 20:21:35 -02:00
Manuel Holtgrewe
4a33cb8d98 Do not display passwords with pull/push/incoming/outgoing
Passwords specified in the repository URL are now displayed as '***'
when accessing the remote repository.
2007-11-05 20:29:32 +01:00
Maxim Dounin
084e15f969 Fix dir-changed-to-file updates on clean workdir.
Workaround for dir-changed-to-file updates mentioned
in rev c3f3393b9096 doesn't actually work since tests
introduced in mentioned changeset prevented dirstate
updates even if working directory updates succeded.

Make tests more relaxed for dirstate operations
not directly accessible from cli. See also issue660.

While here, move _dirs existance check from _decpath()
to _changepath() for unification.
2007-11-07 22:57:28 +01:00
Alexis S. L. Carvalho
d5cac48462 Honour the exec bit when we go back in time.
Fixes issue801.
2007-11-05 18:49:35 -02:00
Maxim Dounin
8561d688a1 Fix file-changed-to-dir and dir-to-file commits (issue660).
Allow adding to dirstate files that clash with previously existing
but marked for removal. Protect from reintroducing clashes by revert.

This change doesn't address related issues with update. Current
workaround is to do "clean" update by manually removing conflicting
files/dirs from working directory.
2007-11-05 20:05:44 +03:00
Rocco Rutte
49a794484a hgweb_mod: update unidiff() calls and finish f2af74bd8f86 job 2007-11-03 17:04:42 +01:00
Bryan O'Sullivan
2a0ef5ab06 Fix context iterator. 2007-11-02 14:44:33 -07:00
Hollis Blanchard
9d5f9ce7a0 Handle patches with misformatted empty lines
Insert a space on empty lines which are missing a control character.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
---
I frequently receive emailed patches with empty lines represented as "\n\n",
where Mercurial expects them to be "\n \n". patch(1) applies these patches
without complaint, but qpush fails all hunks.
2007-11-01 17:15:50 -05:00
Dustin Sallings
bebcdac954 Use both the from and to name in mdiff.unidiff.
This fixes a compatibility issue with git diffs.
* * *
2007-11-01 12:17:59 -07:00
Patrick Mezard
6aa1e21320 Fix Windows os.popen bug with interleaved stdout/stderr output
See python bug 1366 "popen spawned process may not write to stdout under windows" for more details.
2007-11-01 12:05:14 +01:00
Elliott Peele
dae15f3456 https url handling: usernames and passwords were registered to the wrong url 2007-10-30 16:54:25 -07:00
Thomas Arendsen Hein
d3c1b2079e Only set mode of new patch if the target file was removed before.
If the file is writable by the user, but owned by a different user, the
chmod will otherwise fail with "Operation not permitted".

Additionally make very sure that the file is only written if either the number
of links is <= 1 or the file was successfully removed.

Maybe this minimal COW code should be replaced by something from util.
2007-10-25 19:40:56 +02:00
Sebastian Hauer
14709cb72b httprepo: ignore environment proxies when proxies are disabled 2007-10-24 22:15:45 +02:00
Christian Ebert
61e3b4ba58 Catch smtp exceptions 2007-09-07 16:48:42 +02:00
Steve Borho
1ddcdfe3e8 Allow explicit disabling of extensions
If the first character of an extension path is '!', the extension
is silently skipped.
2007-09-18 19:53:01 -05:00
Bryan O'Sullivan
6a52ab5621 osutil: use fdopendir instead of dirfd 2007-10-15 12:57:01 -07:00
Shun-ichi GOTO
bc6b138bfb mpatch: Define Py_ssize_t for old pythons and use it instead of ssize_t.
See also PEP 353.
NOTE: Microsoft compilers (8 or earlier) does not have ssize_t.
2007-10-12 11:46:49 +09:00
Matt Mackall
6983b23f64 osutil: improve portability
- manually inline mode_to_kind
- remove unused alloca include
- remove fstatat and associated bits

It's not obvious that there's an advantage to using fstatat in terms
of performance. The race-avoidance properties of fstatat aren't
terribly useful to us either. So best to avoid it until we figure out
how to use it portably.
2007-10-11 17:46:06 -05:00
Benoit Boissinot
30e763291b fix typo 2007-10-11 16:28:30 +02:00
Benoit Boissinot
6e4d069cc4 import gettext since '_' is used 2007-10-11 16:26:14 +02:00
Benoit Boissinot
c5049e31fc explicitely use integer division 2007-10-11 16:19:12 +02:00
Benoit Boissinot
0442ace6c2 fix UnboundLocalError, refactor a bit
bin wasn't defined in all branches (bug introduced in 959d401a1954
2007-10-11 12:16:55 +02:00
Matt Mackall
0c1648fb37 bdiff: tweaks for large files
- adjust the common line threshold to .1%
  this speeds up a delta of 7M lines of source from 10m to 40s
- adjust the scaling of the hash array down a bit as it was raising the peak
  memory usage significantly
2007-10-11 00:46:56 -05:00
Matt Mackall
81a40fb9b2 revlog: break up compression of large deltas
Python's zlib apparently makes an internal copy of strings passed to
compress(). To avoid this, compress strings 1M at a time, then join
them at the end if the result would be smaller than the original.

For initial commits of large but compressible files, this cuts peak
memory usage nearly in half.
2007-10-11 00:46:54 -05:00
Matt Mackall
0804290ab7 revlog: fix caching of buffer objects 2007-10-11 00:46:53 -05:00
Matt Mackall
8a3a3e49fe chunkiter: handle large reads more efficiently
- for large reads, don't attempt to read more than necessary
- if we've gathered the exact number of bytes needed, avoid a string copy
2007-10-11 00:46:52 -05:00
Matt Mackall
9d62709a2c revlog: avoid large yields in group()
Split large yields so that the downstream consumer (chunkbuffer) will avoid
some pain when reading ahead.
2007-10-11 00:46:51 -05:00
Matt Mackall
d3f1e8a8cf chunkiter: simplify iter logic 2007-10-11 00:46:49 -05:00
Matt Mackall
614d4b8b33 chunkbuffer: removed unused method and arg 2007-10-11 00:46:48 -05:00
Matt Mackall
adbffbec3c revlog: reduce memory usage in addgroup
- use a buffer to extract the delta from a chunk
- avoid concatenating to a compressed delta
- use a buffer to directly extra full text from a trivial delta
- delete chunk and delta objects after use
2007-10-11 00:46:47 -05:00
Matt Mackall
507b4b92da mpatch: allow buffer objects for input 2007-10-11 00:46:45 -05:00
Bryan O'Sullivan
6df62fb77c convert: make contents of "extra" dict available from sources, for sinks.
This breaks hash preservation for hg->hg conversion, as each converted
change gets a convert_revision item added to its extra dict.  Ugh.
2007-10-10 15:30:00 -07:00
Bryan O'Sullivan
69513180ef osutil: Solaris build fix 2007-10-09 08:39:37 -07:00
Bryan O'Sullivan
f32d9d204f Fix build error with Sun C compiler. 2007-10-08 22:45:48 -07:00
Alexis S. L. Carvalho
a6ace30eb5 osutil.c: use strncpy instead of strncat 2007-10-08 21:37:25 -03:00
Matt Mackall
639bd228f5 findcopies: fix rename bug
We've fiddled with this line several times, and an old bug has
reappeared from it. Let's take a peek at the history.

The original "or" (rev 3674, in 0.9.2 and 0.9.3):
  http://www.selenic.com/hg/rev/9099b35951af

Then I changed it to an "and" to fix a bug (rev 4304):
  http://www.selenic.com/hg/rev/c0a9681f37d2

Then for reasons now lost in the mists of time, I dropped half (rev 4399):
  http://www.selenic.com/hg/rev/28b43ceec6c1

Then we added back the "or" (rev 4416, in 0.9.4):
  http://www.selenic.com/hg/rev/1b74e1831bb9

So it seems it ought to be "and".
2007-10-08 18:47:22 -05:00
Matt Mackall
1a6c764cc5 osutil: more tidying
- do_stat -> keep_stat
- all_kinds -> !need_stat
- simplify main error logic
- reorder declarations
2007-10-08 18:47:21 -05:00
Matt Mackall
fb0cad4f74 osutil: move file list loop to its own function 2007-10-08 18:47:18 -05:00
Matt Mackall
cc38448e9d osutil: simplify DT_REG support 2007-10-08 18:47:17 -05:00
Matt Mackall
dafe26ed0b osutils: pull file stat loop into its own function 2007-10-08 18:47:16 -05:00
Matt Mackall
20936fe972 osutil: fold stat paths together
- simplify st/py_st logic
- use stp to point to stat buffer
- combine stat paths
2007-10-08 18:47:15 -05:00
Matt Mackall
65e8ee71fa osutil: more cleanups
- eliminate a level of nesting
- untab targets of gotos
2007-10-08 18:47:14 -05:00
Matt Mackall
50cce1cc95 osutil: eliminate alloca call
- make full_path a PATH_MAX + epsilon local buffer
- use strncpy and strncat
2007-10-08 18:47:12 -05:00
Matt Mackall
638a3ac761 osutil: cleanups
- use tabs
- eliminate old-style function pointer calls
- eliminate weird scoping
- eliminate assignment-in-iff
- use !foo rather than foo == NULL
2007-10-08 18:47:06 -05:00
Rafael Villar Burke
1b278771bf Execution bit detection fixes for VFAT on Linux
On Linux VFAT execution mode can be modified, but changes don't
persist a filesy stem remount. The current test can be trickled by
this. We can help with the det ection of VFAT checking whether new
files get created with the execution bits on
 (as usually these partitions are mounted with the exec option, for
convenience)
.
2007-10-05 01:52:53 +02:00
Patrick Mezard
59a5193f63 patch: fix git sendmail handling without proper mail headers 2007-10-08 22:20:23 +02:00
Giorgos Keramidas
a1efeccfd8 osutil.c: style fix - delete trailing end-of-line spaces 2007-10-07 21:56:36 +03:00
Patrick Mezard
2dee2a1086 Fix workingctx exec/link bit of copies on non-supporting systems 2007-10-07 15:07:35 +02:00
Patrick Mezard
c9215420e8 Display symlink or executable bit with manifest -v
New output looks like:

644   a
755 * b/a
644 @ l
2007-10-06 22:30:22 +02:00