Commit Graph

6925 Commits

Author SHA1 Message Date
Mads Kiilerich
75f680564e hgweb: make paths wildcards expanding in a repo root match repo correctly
There was a trailing '/' too much when the wildcard part expanded to nothing.
The consequence was that the repo was announced but didn't work.
2011-02-15 01:04:10 +01:00
Mads Kiilerich
6e8efc0e0c hgweb: doctest of url creation from wildcard expansion 2011-02-15 01:04:10 +01:00
Dan Villiom Podlaski Christiansen
ec590d5cd4 explicitly close files
Add missing calls to close() to many places where files are
opened. Relying on reference counting to catch them soon-ish is not
portable and fails in environments with a proper GC, such as PyPy.
2010-12-24 15:23:01 +01:00
jfh
76026ecba1 add debugignore which yields the combined ignore patten of the .hgignore files
For GUI clients its sometimes important to know which files will be ignored and
which files will be important. This allows the GUI client to skipping redoing a
'hg status' when the files are ignored but have changed. (For instance, a
typical case is that the "build" directory inside some project is ignored but
files in it frequently change.)
2011-01-15 16:02:03 +01:00
Gastón Kleiman
f4afcea9fa diffstat: fix parsing of filenames with spaces
The patch changes the output of "hg diff --stat" when one file whose filename
has spaces has changed, making it get the full filename instead of just the
substring between the last space and the end of the filename.

It also changes the diffstat generated by "hg email -d" when one of the commit
messages starts with "diff". Because of the regex used to parse the filename,
the diffstat generated by "hg email -d" will still be not correct if a commit
message starts with "diff -r ".

Before the patch Mercurial has the following behavior:

$ echo "foobar">"file with spaces"
$ hg add "file with spaces"
$ hg diff --stat
 spaces |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
$ hg diff --git --stat
 file with spaces |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

After the patch:

$ echo "foobar">"file with spaces"
$ hg add "file with spaces"
$ hg diff --stat
 file with spaces |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
$ hg diff --git --stat
 file with spaces |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Before the patch:

$ hg add mercurial/patch.py tests/tests-diffstat.t
$ hg commit -m "diffstat: fix parsing of filenames"

$ hg email -d --test tip
This patch series consists of 1 patches.

diffstat: fix parsing of filenames
[...]

 filenames             |    0
 mercurial/patch.py    |    6 ++++--
 tests/test-diffstat.t |   17 +++++++++++++++++
 3 files changed, 21 insertions(+), 2 deletions(-)
[...]

After the patch:

$ hg email -d --test tip
This patch series consists of 1 patches.

diffstat: fix parsing of filenames

[...]

 mercurial/patch.py    |    6 ++++--
 tests/test-diffstat.t |   17 +++++++++++++++++
 3 files changed, 21 insertions(+), 2 deletions(-)
[...]
2011-02-04 16:32:14 -03:00
Roman Sokolov
ba47cd9ff8 dispatch: use flag cmdalias.shell for detecting shell aliases 2011-02-10 15:41:34 +03:00
Roman Sokolov
00ca6be77b dispatch: debug message for missing arguments in shell alias
Shows debug message if alias definition contains substitution variables,
but insufficient number of arguments supplied.
2011-02-11 03:46:28 +03:00
Roman Sokolov
7a0b42e376 dispatch: support for $ escaping in shell-alias definition
Sigils in shell-alias can be escaped by doubling them.
2011-02-11 03:32:40 +03:00
Adrian Buehlmann
35765bcb3b fncachestore: defer updating the fncache file to a single file open
Defers updating the fncache file with newly added entries to the end of
the transaction (on e.g. pull), doing a single open call on the fncache
file, instead of opening and closing it each time a new entry is added
to the store.

Implemented by adding a new abstract write() function on store.basicstore
and registering it as a release function on the store lock in
localrepo.lock (compare with dirstate.write).

store.fncachestore overrides write() from basicstore and calls a new
write function on the fncache object, which writes all entries to the
fncache file if it's dirty.

store.fncache.add() now just marks itself as dirty if a new name is added.
2011-01-28 13:38:34 +01:00
Adrian Buehlmann
658ccc6bdb localrepo: acquire lock on stream_in 2011-01-28 13:34:07 +01:00
David Soria Parra
6759d1e574 localrepo: sort hg bookmark output
sort bookmarks before we write them to stdout to get a predictable output.
2011-02-11 20:35:32 +01:00
Steve Borho
712b02dd36 url: return the matched authentication group name from readauthforuri()
Internally, the group name is only used in debug statements, but readauthforuri
can be also used externally to determine which group will be matched for a given
URL.
2011-02-13 12:19:58 -06:00
Steve Borho
dbbd9916fa url: move [auth] parsing out into a utility function
No functionality change, but it makes the [auth] section parsing and
best match detection usable by third party tools
2011-02-12 21:59:43 -06:00
Steve Borho
38702faab3 url: use rsplit to split [auth] keys
None of the auth section subkeys include a period, so it makes zero
sense to not split from the end.  By using rsplit() users can use
the hostname as group keys.
2011-02-12 21:53:27 -06:00
David Soria Parra
ff428aae17 templates: add bookmarks to command line styles 2011-02-11 20:35:30 +01:00
David Soria Parra
60c47bdb07 templater: add bookmarks to templates and default output
as bookmarks are not dispalyed as tags anymore, we add a bookmark label
to the changeset printer.
2011-02-11 19:47:39 +01:00
David Soria Parra
7547a71806 tags: do not merge bookmarks with tags
bookmarks are no tags, therefore they should not be returned as tags.
2011-02-11 19:44:17 +01:00
David Soria Parra
9a6f3a9ae7 context: add method to return all bookmarks pointing to a node 2011-02-11 19:36:15 +01:00
Adrian Buehlmann
9e0069c080 Make sure bundlerepo doesn't leak temp files (issue2491)
Add empty repository.close() and call it in dispatch.

Remove bundlerepository.__del__(), merging it into bundlerepository.close(),
which overrides repository.close().

http://docs.python.org/reference/datamodel.html says:

"It is not guaranteed that __del__() methods are called for objects that
still exist when the interpreter exits."
2011-02-12 10:58:11 +01:00
David Soria Parra
c2b26a0902 bookmarks: read current bookmark as utf-8 and convert it to local 2011-02-11 19:32:49 +01:00
Adrian Buehlmann
5a005c60c3 eliminate win32.user_rcpath_win32() 2011-02-14 11:13:05 +01:00
Adrian Buehlmann
c0a4dc75ea windows: eliminate system_rcpath_win32() 2011-02-14 11:12:57 +01:00
Adrian Buehlmann
2f13e93b12 win32: move system_rcpath_win32() to windows.py
no code change in system_rcpath_win32

This breaks the dependency from the win32 module on osutil
2011-02-14 11:12:35 +01:00
Adrian Buehlmann
a264a23ffa win32: new function executable_path 2011-02-14 11:12:31 +01:00
Adrian Buehlmann
77ab03f101 port win32.py to using the Python ctypes library
The pywin32 package is no longer needed.

ctypes is now required for running Mercurial on Windows.

ctypes is included in Python since version 2.5. For Python 2.4, ctypes is
available as an extra installer package for Windows.

Moved spawndetached() from windows.py to win32.py and fixed it, using
ctypes as well. spawndetached was defunct with Python 2.6.6 because Python
removed their undocumented subprocess.CreateProcess. This fixes
'hg serve -d' on Windows.
2011-02-14 11:12:26 +01:00
Adrian Buehlmann
9669b3b2bc win32: optimize parameters for the CreateFile call in _getfileinfo
Set dwDesiredAccess to 0 instead of GENERIC_READ.
Zero is  enough for querying the file metadata. We don't even need to
access the -contents- of the file.

Set dwShareMode to FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
instead of the overly restrictive FILE_SHARE_READ.
There is no need to cause write or delete accesses by other processes to
fail while we are querying file metadata.

See http://msdn.microsoft.com/en-us/library/aa363858(v=vs.85).aspx
2011-02-14 11:12:22 +01:00
Matt Mackall
d27d1fae16 bookmarks: move push/pull command features to core 2011-02-10 13:46:28 -06:00
Matt Mackall
75941859fe bookmarks: merge current tracking on update into core 2011-02-10 13:46:28 -06:00
Matt Mackall
7f7e9f2814 bookmarks: merge incoming/outgoing into core 2011-02-10 13:46:28 -06:00
Matt Mackall
50f1b0a0aa bookmarks: merge suspect addchangegroup into core
This is marked with FIXME because it's not clear that it makes any sense.
2011-02-10 13:46:28 -06:00
Matt Mackall
fea21bd858 bookmarks: merge low-level push/pull support into core 2011-02-10 13:46:28 -06:00
Matt Mackall
20e7dee431 bookmarks: merge lookup into localrepo 2011-02-10 13:46:28 -06:00
Matt Mackall
d3d3054cf5 bookmarks: move strip support to repair 2011-02-10 13:46:28 -06:00
Matt Mackall
ca3d079172 bookmarks: merge _findtags method into core 2011-02-10 13:46:28 -06:00
Matt Mackall
018d171646 bookmarks: move revset support to core 2011-02-10 13:46:28 -06:00
Matt Mackall
89896dbd54 bookmarks: merge invalidation into core 2011-02-10 13:46:27 -06:00
Matt Mackall
0dfef4c009 bookmarks: move commit action into core 2011-02-10 13:46:27 -06:00
Matt Mackall
77f373813e bookmarks: merge rollback support into localrepo 2011-02-10 13:46:27 -06:00
Matt Mackall
6e122bd621 bookmarks: move property methods into localrepo 2011-02-10 13:46:27 -06:00
Matt Mackall
1b243d934f bookmarks: move diff to core 2011-02-10 13:46:27 -06:00
Matt Mackall
3d6c8e8713 bookmarks: move pushkey functions into core 2011-02-10 13:46:27 -06:00
Matt Mackall
2580f39614 bookmarks: move update into core 2011-02-10 13:46:27 -06:00
Matt Mackall
7b71e510e5 bookmarks: move read methods to core 2011-02-10 13:46:27 -06:00
Matt Mackall
0506b0dd9c bookmarks: move basic io to core 2011-02-10 13:46:27 -06:00
Matt Mackall
906534053e extensions: add an ignore list for old extensions 2011-02-10 13:46:27 -06:00
Javi Merino
5ca27e6961 doc: Add back quotes around filenames
Filenames starting with a dot (.hg and .hgignore) confuse man when
creating the ps documentation with "man -t hg >hg.ps" if they are not
enclosed in back quotes.
2011-02-05 13:59:34 +00:00
Martin Geisler
6090144a5b merge with stable 2011-02-04 09:17:07 +01:00
Jonathan Nieder
59cebab2ef backout: make help more explicit about what backout does
The help for backout explains:

   The backout command merges the reverse effect of the reverted
   changeset into the working directory.

Unfortunately, that does not make it obvious to a newcomer what the
backout command does.  Since it performs a 3-way merge, what is the
common ancestor?  Will the result be automatically committed?  What is
this reverted changeset --- is it the rev passed with -r on the
command line or its inverse?

So try to clarify the description, avoiding jargon and being
explicit about what happens from the user's perspective.

Thanks to Gilles Moris, Steve Borho, Kevin Bullock, and timeless for
help.
2011-02-03 00:27:44 -06:00
trbs
2b860c833d subrepo: fix pruning of subrepo filenames in dirstate (issue2619) 2011-02-04 09:05:23 +01:00
Adrian Buehlmann
573f584562 opener: use posixfile to hold file open when calling nlinks()
Mercurial's posixfile is less intrusive on Windows than Python's open
2011-02-02 13:51:22 +01:00