Commit Graph

5256 Commits

Author SHA1 Message Date
Adrian Buehlmann
d2944ad3db util: state docstring of rename more precisely 2009-10-07 20:16:43 +02:00
Greg Ward
889a9ffb8d cmdutil: changeset_printer: use methods of filectx/changectx.
This allows extensions that modify changeset metadata (e.g.
description) by overriding methods of changectx to get consistent
behavior from all log-like commands, regardless of whether templates
or styles are used. Without this, overriding changectx methods works
if you use styles or templates, but not with default log format.

This meant adding filectx.extra() for consistency with changectx.
2009-10-05 18:17:13 -04:00
Patrick Mezard
c463f2299e verify: detect file copy sources not in parents with --verbose 2009-10-06 22:46:31 +02:00
Steve Borho
7ec5773565 Merge with crew-stable 2009-10-06 16:08:38 -05:00
Adrian Buehlmann
692aa6b826 util.rename: do not abort if os.unlink fails (issue1840) 2009-10-06 10:45:23 +02:00
Martin Geisler
8b8fb723b7 help: un-indent help topics
The help topics are reused in the HTML documentation, and there it
looks odd that whole sections are indented. We now only indent it for
output on the terminal.
2009-10-04 12:18:43 +02:00
Martin Geisler
524b665b54 help: move help topics from mercurial/help.py to help/*.txt
The help topics are loaded on demand so we wont hit the disk unless we
really have to.
2009-10-04 09:59:13 +02:00
Martin Geisler
3550fb27d7 i18n: remove unnecessary os.path.normpath call 2009-10-03 18:58:25 +02:00
Martin Geisler
cb4bdf9a1e commands: simpler sort of help topic names 2009-10-04 10:17:01 +02:00
Mads Kiilerich
8ff24147fd cmdutil: templating keywords latesttag and latesttagdistance
This can be used for referring to revisions in a reasonable
meaningful, stable and monotonically increasing way, suitable for
releases or builds directly from a repository.

The latest tag is found by searching through untagged ancestors and
finding the latest tagged ancestor based on tag date. The distance is
found from the length of the longest path to the tagged revision.

For example:
  hg log -l1 --template '{latesttag}+{latesttagdistance}\n'
can return
  1.3.1+197

This is mostly work by Gilles Moris <gilles.moris@free.fr>
2009-10-03 18:31:20 +02:00
Benoit Boissinot
b0e2f2aa9e merge with mpm 2009-10-03 23:38:10 +02:00
Benoit Boissinot
3978618d04 bdiff: gradually enable the popularity hack
Patch from Jason Orendorff

The lower the threshold, the stronger the popularity hack's
influence. So at 3999 lines, the hack is disabled; and at 4000 lines,
the hack is enabled at maximum strength (t=4).

No source file in mercurial/crew is over 4000 lines. But there are, oh,
a few such files in Mozilla.  I can testify that this hack causes hg to
generate some correct but eyebrow-raising patches.

I think the hack should phase in gradually. The threshold should be high
for small files where we don't need it so much.  Like this:

        t = (bn < 31000) ? 1000000 / bn : bn / 1000;

That would leave the popularity hack disabled for small files, then
gradually phase it in:

    bn <   1000   --   t > bn    (popularity hack is completely disabled)
    bn ==  1000   --   t = 1000  (still effectively disabled)
    bn ==  2000   --   t =  500  (only hits unusual files)
    bn == 10000   --   t =  100  (only hits especially common lines)
    bn == 31000   --   t =   31  (hack is at maximum power)
    bn == 32000   --   t =   32  (hack could backfire, ease off)
2009-10-03 23:36:08 +02:00
Greg Ward
0957bc4d5c dirstate: add/improve method docstrings.
- add doc to __init__(), _map(), status()
- enhance for __getitem__()
- fix inaccurate doc for walk() (described wrong return type)
2009-10-01 15:36:45 -04:00
Martin Geisler
42c594dc7e Merge with crew-stable 2009-09-27 09:38:53 +02:00
Martin Geisler
72cc7c5356 util: do not corrupt multi-byte characters in wrap 2009-09-27 01:44:46 +02:00
Sune Foldager
30958eab97 push: fix subtle bug in prepush logic
A test case demonstrating the bug has been added.
Contributed by Henrik Stuart and Sune Foldager.
2009-09-23 18:56:09 +02:00
Adrian Buehlmann
d88b8724c3 mention overlay bundle file in global --repository option
see http://mercurial.selenic.com/wiki/LookingIntoBundles

Drop mentioning symbolic path names for the sake of brevity. This is
a common feature of path options anyway.
2009-09-23 15:57:25 +02:00
Dirkjan Ochtman
a023094f1f merge with crew-stable 2009-09-23 15:54:43 +02:00
Sune Foldager
362c2022cc localrepo: fix bugs in branchheads and add docstring
- The call to reverse() reversed the list in place in the global branchmap.
- The nodesbetween function doesn't preserve ordering.
2009-09-23 15:51:36 +02:00
Mads Kiilerich
097282895a util.system: Use subprocess instead of os.system
subprocess allows the environment and working directory to be specified
directly, so the hacks for making temporary changes while forking is no longer
necessary.

This also fixes failures on solaris where the temporary changes can't be undone
because there is no unsetenv.
2009-09-20 22:19:18 +02:00
Martin Geisler
969ff27288 Merge with crew-stable 2009-09-19 13:55:18 +02:00
Martin Geisler
af0872c777 dispatch: catch ConfigError while constructing ui 2009-09-19 13:52:54 +02:00
Stuart W Marks
928c430865 hg: say 'hg update' instead of 'hg up' in merge status message
Includes the change to the message itself, along with several test
output files that also had to change.
2009-09-17 22:39:38 -07:00
Martin Geisler
9f1896c083 do not attempt to translate ui.debug output 2009-09-19 01:15:38 +02:00
Steve Borho
136a6eb1d4 demandimport: blacklist gtk
Demandimport breaks gtk.  You get a meaningless error about
'failed loading gobject\_gobject.pyd'.  Mercurial does not use gtk,
but this trips up many extension writers.
2009-09-17 17:39:43 -05:00
Martin Geisler
74a6226f22 Merge with crew-stable 2009-09-17 21:52:08 +02:00
Martin Geisler
eb95e5f9c1 commands: expand -c and -C in update error message 2009-09-17 21:50:12 +02:00
Stuart W Marks
fd1368d11d commands: forbid 'hg update --check --clean' 2009-09-17 21:34:05 +02:00
Steve Borho
68d79882b6 windows: provide filename in IOError exceptions
This brings the Windows posixfile errors in line with the errors
on other platforms.
2009-09-14 19:53:43 -05:00
Martin Geisler
cc89e210eb hg: avoid combining translated strings
Combining translated string fragments into bigger strings is bad
practice because it removes context from the fragments. The translator
sees the fragments in isolation and might not jump back to the source
to see how a string like "%d files %s" is actually used.
2009-09-14 23:48:25 +02:00
Steve Borho
9a9a300480 Merge with crew-stable 2009-09-15 11:18:12 -05:00
Nicolas Dumazet
7626c98965 config: abort on indented non-continuation lines (issue1829)
Previously, as soon as a continuation would be met, "cont" would stay
forever set to True, but "item" was set back to "None".
This caused the continuation code bits to run every time, until the next
"self.get(section, item) + '\n'" which would crash.
2009-09-12 11:17:07 +02:00
Greg Ward
d0559b076a Improve some docstrings relating to changegroups and prepush(). 2009-09-08 17:58:59 -04:00
Andrey Somov
2ccddf5ead improve code readability 2009-09-09 11:12:36 +02:00
Patrick Mezard
f6c5bd6fa1 Merge with crew-stable 2009-09-05 19:39:46 +02:00
Patrick Mezard
d68b916da4 merge: exclude common ancestor from --preview (issue1818) 2009-09-05 18:56:51 +02:00
Martin Geisler
235f78e4fb Merge with crew-stable 2009-09-04 23:34:51 +02:00
Christian Ebert
ebde959a47 log: prevent negative date range from displaying entire log (issue1805) 2009-09-04 11:51:28 +02:00
Benoit Boissinot
a98dab4110 manifest/revlog: do not let the revlog cache mutable objects
If a buffer of an mutable object is passed to revlog.addrevision(), the revlog
will happily store it in its cache. Later when the revlog reuses the cached
entry, if the manifest modified the object in-between, all kind of bugs
appears.

We fix it by:
- passing immutable objects to addrevision() if they are already available
- only storing the text in the cache if it's of str type

Then we can remove the conversion of the cache entry to str() during
retrieval. That was probably just there hiding the bug for the common cases
but not really fixing it.
2009-09-04 10:47:55 +02:00
Martin Geisler
298efc8d54 util, minirst: do not crash with COLUMNS=0 2009-09-03 21:07:06 +02:00
Benoit Boissinot
68e9caf50f manifestdict: remove unnecessary dictionary copy
No need to copy the dict, dict.__init__() will do that for us.
It was responsible for a non-negligeable waste of time during a qpush of an
-mm queue on the kernel repo.
2009-09-03 02:42:56 +02:00
Benoit Boissinot
1b0af4b591 manifest.add(): cleanup worklist construction and iteration 2009-09-02 21:05:43 +02:00
Benoit Boissinot
ef4ae33a57 manifest: simplify cache handling, use a unique cache 2009-09-02 21:05:01 +02:00
Benoit Boissinot
79eb77ecc4 manifest.add(): simplify with iterators and generator expressions 2009-09-02 20:18:35 +02:00
Matt Mackall
c34b180a9c Make distinct lookup error for localrepo.lookup
This allows clone/share to correctly distinguish lookup errors from
corruption errors and catch only the former.
2009-08-31 10:58:33 -05:00
Nicolas Dumazet
9e39f64d52 parsers.c: parse_manifest: fixing refcount of flags
When flags was DECREF'ed, scope was referencing to the outer variable,
outside of the block.
It was in fact always NULL: the real Python object was never decref'ed.
2009-08-27 14:15:04 +02:00
Dirkjan Ochtman
845db1fb2d hgweb: show diff header line in raw diffs 2009-08-26 14:58:09 +02:00
Carey Evans
28b2e6acc5 util: Fix date format for 12-hour time. 2009-08-21 21:52:57 +12:00
Adrian Buehlmann
0a39b63526 dirstate.write: don't ignore stat data if mtime is in the future (issue1790)
This change narrows the race guard that was introduced by ffd022830d6d
("dirstate: ignore stat data for files that were updated too recently")
to not discard the _map entry's stat data if the mtime is in the future.

Without this change, status locks files having odd mtimes in the future
into the 'unset' state, causing needless file compares later (admittedly
harmless), but also inflicting highly irritating sticky effects on
tools/plugins that directly read .hg/dirstate (e.g. TortoiseHg).
2009-08-21 14:17:23 +02:00
Martin Geisler
01be01a4e5 help: show results of all date filters 2009-08-18 13:40:19 +02:00