Commit Graph

2958 Commits

Author SHA1 Message Date
Dan Villiom Podlaski Christiansen
511c941422 prevent transient leaks of file handle by using new helper functions
These leaks may occur in environments that don't employ a reference
counting GC, i.e. PyPy.

This implies:
 - changing opener(...).read() calls to opener.read(...)
 - changing opener(...).write() calls to opener.write(...)
 - changing open(...).read(...) to util.readfile(...)
 - changing open(...).write(...) to util.writefile(...)
2011-05-02 10:11:18 +02:00
Peter Arrenbrecht
66c54cef75 bundlerepo: fix and improve getremotechanges
Fixes the regression where incoming could show local changes
introduced by rev eecf03f0ef7c.
2011-05-02 12:36:23 +02:00
Sune Foldager
f3630ec41e merge with mpm 2011-05-01 19:44:28 +02:00
Mads Kiilerich
32994f27cc convert: handle invalid subversion source paths 2011-05-01 17:35:05 +02:00
Mads Kiilerich
6688bea829 convert: also catch missing revlogs when introduced in repo roots
The previous behaviour was almost as if convert.hg.ignoreerrors was always set
for revisions without parents, except that errors were silently ignored. Revlog
errors are handled as a side effect of getcopies(), but getcopies() was only
called when convert.hg.ignoreerrors was set.

Now we always call self.getcopies for root revisions, not only when
convert.hg.ignoreerrors is set, just like we do on all other revisions.
The extra call might be a bit expensive, but the proper fix for that would be
to catch these errors in another way.
2011-05-01 17:34:16 +02:00
Dan Villiom Podlaski Christiansen
261e0642d3 color: fix using multiple effects 2011-05-01 16:54:48 +02:00
timeless
ab34ee7694 remove unused imports 2011-05-01 15:21:57 +02:00
Patrick Mezard
ebc1f0434a graphlog: always sort revisions topologically
The grapher cannot really handled revisions if they are not emitted in
topological order. The previous 'reverse()' revset was not enough to achieve
that and was replaced by an explicit sort call for simplicity. The --limit
option is now also handled as usual with cmdutil.loglimit() instead of a
'limit' revset.
2011-05-01 15:51:52 +02:00
Patrick Mezard
399c49e7c9 graphlog: take the union of --rev specs instead of the intersection 2011-05-01 15:51:48 +02:00
Patrick Mezard
aaafe977fe graphlog: display nodes with more than 2 predecessors
While nodes with more than 2 parents do not exist in revision graphs, they do
appear when you transform them by removing subgraphs while trying to preserve
ancestry links.

This code was borrowed from Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
pbranch extension.
2011-05-01 15:51:20 +02:00
Matt Mackall
e941b69730 merge with stable 2011-05-01 06:06:59 -05:00
Brodie Rao
5a336c7b00 color: use ui.formatted() to test TTYness, not sys.stdout.isatty()
This fixes the color extension not working with pager (broken in
cab5f9b68e3a). The pager extension already sets ui.formatted=True to
allow this use case.
2011-05-01 12:14:22 +02:00
Nicolas Dumazet
892f3cacb5 zeroconf: notify the Zeroconf threads when hg exits
Zeroconf launches two threads in the background, and they wait on
Condition objects to exit. We need to call Zeroconf.close() to
release those conditions so that threads can gracefully exit.

This means that an interrupt on the hg process will now gracefully
propagate to the Zeroconf children, fixing that bug which did not
allow us to kill an `hg serve` process.
2011-04-30 19:36:59 +02:00
Augie Fackler
720e112a65 color: verify stdout is a tty before using curses
Without this change, curses complains when invoked in certain contexts
because stdout isn't a tty (such as emacs integration) but we ask it
to check for various bits of information from terminfo.
2011-04-30 11:18:43 -05:00
Patrick Mezard
57542c9154 graphlog: log -G --follow file does not work, forbid it
We do not have revsets to follow file history.
2011-04-30 19:42:00 +02:00
Patrick Mezard
f59a4cb18e graphlog: unify log -G revset translation 2011-04-30 19:42:00 +02:00
Patrick Mezard
305ae5565a graphlog: fix log -G --prune
follow() revset really means '::.' while we want something based on the passed
argument. Also, ancestors() revset does not include the parent revisions.
2011-04-30 19:42:00 +02:00
Patrick Mezard
3c82515646 graphlog: escape log -G single value option arguments 2011-04-30 19:42:00 +02:00
Patrick Mezard
eec16f919e graphlog: fix log -G --removed
Current version was mispelled and processed like a valued argument.
2011-04-30 19:42:00 +02:00
Patrick Mezard
caf334a147 graphlog: fix log -G option types when translating to revset
For instance, --keyword is a multiple value option while it was processed as a
single value option.
2011-04-30 19:42:00 +02:00
Kevin Gessner
bf8c80ca9d extensions: obsolete and remove parentrevspec extension
As of 48639b58ef80, revsets implements the ^ and ~ operators that this
extension provides, so it's no longer necessary.
2011-04-30 18:27:39 +02:00
Brodie Rao
b7f0d2a103 url: move URL parsing functions into util to improve startup time
The introduction of the new URL parsing code has created a startup
time regression. This is mainly due to the use of url.hasscheme() in
the ui class. It ends up importing many libraries that the url module
requires.

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

perfstartup time before the URL refactoring (707e4b1e8064):

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

current startup time (9ad1dce9e7f4):

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

after this change:

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

This fixes an actual bug exposed by the change in test-bundle-r.t
where we try to bundle a changeset while specifying that said changeset
is to be assumed already present in the target. This used to still
bundle the changeset. It no longer does. This is similar to the bugs
fixed by the recent switch to heads/common for incoming/pull.
2011-04-30 17:21:37 +02:00
Augie Fackler
9398f9dfcc Zeroconf: catch both ValueError and KeyError in get()
This prevents a traceback during discovery of available hosts.
2011-04-30 07:30:38 -05:00
Idan Kamara
856702f469 mq: add '.' and '..' to list of forbidden patch names
When an empty string is being passed to normname
it would return '.' causing checkfile() to always
return that a patch with that name exists.
2011-04-29 22:21:13 +03:00
Idan Kamara
6862ebb98f mq: be more explicit on invalid patch name message 2011-04-29 22:21:13 +03:00
Matt Mackall
3b61150db3 merge with stable 2011-04-30 03:44:31 -05:00
Steven Stallion
b6327cdf0a extdiff: add repository root as a variable
Some external diff tools (notably Plan 9 diff(1)) require the absolute path
to the file being diffed for proper function. A root variable was added to
inform an external tool of the repository root (the tool is invoked with the
cwd set to tmproot).
2011-04-27 21:55:46 -04:00
Alexander Solovyov
f4250e8e9c graphlog: make use of graphmod's revset support 2011-04-23 15:04:15 +02:00
Alexander Solovyov
517dbf068d graphmod: use revsets internally
Thanks for the idea and most of the implementation to Klaus Koch

Backs revisions() and filerevs() with DAG walker which can iterate through
arbitrary list of revisions instead of strict one by one iteration from start to
stop. When a gap occurs in a revisions (i.e. in file log), the next topological
parent within the revset is searched and the connection to it is printed in the
ascii graph.

File graph can draw sometimes more connections than previous version, because
graph is produced according to the revset, not according to a file's filelog.

In case the graph contains several branches where the left parent is null, the
graphs for each are printed sequentially, not in parallel as it was a case
earlier (see for example the graph for README in hg-dev).
2011-03-13 15:53:38 +01:00
Alexander Solovyov
7a9d95a376 churn: strip key earlier to avoid false negative seach in aliases 2011-04-29 16:34:52 +02:00
Patrick Mezard
5457fb5aec strip: make it clear that --force discards changes (issue310) 2011-04-29 14:56:23 +02:00
Thomas Arendsen Hein
e6dcc5994e merge with stable 2011-04-29 11:10:11 +02:00
Patrick Mezard
2cbeb4b9c6 extdiff: fix broken symlinks handling (issue1909) 2011-04-29 08:04:46 +02:00
Pierre-Yves David
7b3f2de931 mq: prevent traceback when qfinish patches not in series.
When mq status entry referencing a patches that is not in series  `hg qfinish
-a` used to issue a traceback. This states is inconsistent but might happen
regularly when people misuse hg up -mq.

This changeset prevent hg from crashing. The faulty entry is finished anyway and
a warning is issued.
2011-04-25 14:03:12 +02:00
Patrick Mezard
44388c0fa1 color: code simplification 2011-04-24 23:06:19 +02:00
Danek Duvall
e826f21afa color: add support for terminfo-based attributes and color
Using terminfo instead of hard-coding ECMA-48 control sequences provides a
greater assurance that the terminal codes are correct for the current
terminal type; not everything supports the ANSI escape codes.

It also allows us to use a wider range of colors when a terminal emulator
supports it (such as 16- or 256-color xterm), and a few more non-color
attributes, such as the ever-popular blink.
2011-04-21 13:47:45 -07:00
Patrick Mezard
95e7147cd4 convert: make filemap prune useless branch closing revs (issue2774)
A branch closing revision only applies if one of its parents belongs to the
branch being closed. Otherwise the filemap can prune it too.
2011-04-20 23:15:18 +02:00
Adrian Buehlmann
f3e8eae526 move canonpath from util to scmutil 2011-04-20 21:41:41 +02:00
Adrian Buehlmann
cf126bb7dd move opener from util to scmutil 2011-04-20 19:54:57 +02:00
Patrick Mezard
e29463618b merge with stable 2011-04-20 23:30:07 +02:00
timeless
ccf3a292e9 qrecord: provide help when mq is not enabled 2011-04-14 10:00:15 +02:00
Matt Mackall
24e0621116 zeroconf: clean up naked exceptions 2011-04-13 12:57:24 -05:00
Idan Kamara
35892dd390 color: reset win32 console color in a finally block 2011-04-09 23:53:23 +03:00
Stefano Tortarolo
e2565790ee rebase: don't mark file as removed if missing in parent's manifest (issue2725) 2011-03-27 13:34:20 +02:00
Martin Geisler
9e82c0f40f patchbomb, help/hgweb: do not refer to config files as hgrc files 2011-04-01 12:14:42 +02:00
timeless@gmail.com
4f2e8b67dc mq: fix qselect help for qguard 2011-03-29 16:45:23 +03:00
Stefano Tortarolo
d1da6cf615 mq: fix typo in docstring 2011-03-15 14:55:16 +01:00
Martin Geisler
a0a2144b94 i18n: don't mark trivial string for translation 2011-03-16 17:38:25 +01:00
Martin Geisler
87e06b967c relink: mark abort message for translation 2011-03-16 15:34:45 +01:00