Commit Graph

7292 Commits

Author SHA1 Message Date
Patrick Mezard
4e7e0fa921 code indentation fixes 2011-03-23 23:33:14 +01:00
Benoit Boissinot
4e06bc9a34 bookmarks: discard current bookmark if absent from the bookmarks (issue2692)
After a rollback, the current bookmark might be absent from the bookmarks
file. In that case we discard it instead of displaying a traceback during
commit.
2011-03-13 14:36:47 +01:00
Benoit Boissinot
bd2935644e bookmarks: fix update of the current bookmark during rename
We need to get rid of the previous bookmark after changing current bookmark.
2011-03-13 15:42:24 +01:00
Dirkjan Ochtman
a6534a6498 templates: widen the graph canvas (issue2683) 2011-03-13 14:26:32 +01:00
Dirkjan Ochtman
43eea49bf4 hgweb: pmezard thinks one default is enough 2011-03-12 16:00:54 +01:00
Dirkjan Ochtman
d17590d4e7 deal with empty Content-Length headers 2011-03-12 15:21:45 +01:00
Alexander Solovyov
84912d6eaf hgweb: add separate page with bookmarks listing 2011-03-12 11:20:03 +01:00
Alexander Solovyov
e67bfa95ac hgweb: add display of bookmarks for changelog and changeset 2011-03-12 11:19:44 +01:00
Steve Borho
fe1b6543d5 filemerge: introduce a 'regkeyalt' merge tool variable
This allows us to provide alternate search keys for 64bit operating systems that
may have 32bit merge tools installed.  Presumably it may find other uses.
2011-03-08 13:05:18 -06:00
Patrick Mezard
cb64444c5f subrepo: backout 66e642f0195f, --force requires svn >= 1.5 2011-03-07 23:02:04 +01:00
Eric Eisner
25b04beb36 subrepo: don't crash when git repo is missing 2011-03-07 12:03:54 -05:00
Matt Mackall
ec99e4f807 ancestor: rewrite to deal with crossed linkrevs (issue2682)
This version is about 10% slower, possibly because it visits some
revisions in a different topological order than what's in the revlog.
2011-03-07 15:44:43 -06:00
Matt Mackall
81bd0b7967 merge: back out single-parent fast-forward merge
This backs out

 changeset:   13158:17d1b96c0f12
 user:        Mads Kiilerich <mads@kiilerich.com>
 date:        Tue Dec 07 03:29:21 2010 +0100
 summary:     merge: fast-forward merge with descendant

Before named branches, the invariants were:

a) "merges" always have two parents
b) p1 is not linearly related to p2

Adding named branches made (b) problematic, so the above patch was
introduced, which fixed (b) but broke (a).

After discussion, we decided that the invariants should be:

a) "merges" always have two parents
b) p1 is not linearly related to p2 OR p1 and p2 are on different branches
2011-03-07 15:03:10 -06:00
Matt Mackall
f9bf397695 merge: drop resolve state for mergers with identical contents (issue2680) 2011-03-05 16:34:59 -06:00
Patrick Mezard
67ea8032d8 hgweb: fix filelog rss links generation 2011-03-06 22:03:30 +01:00
Patrick Mezard
3b5fe963d1 hgweb: use tip in gitweb/monoblue filelog rss links (issue2677) 2011-03-06 22:03:18 +01:00
timeless
49d2d3233b cacert: improve error report when web.cacert file does not exist 2011-03-06 10:27:07 -06:00
Patrick Mezard
ee7651120f Improve unresolved merge conflicts warning (issue2681)
Suggested by Antoine Pitrou <pitrou@free.fr>
2011-03-06 15:21:50 +01:00
Matt Mackall
a4d6678bab match: ignore "" patterns
The following command would visit every changeset in repo/ rather than
the last 10:

hg log -l 10 repo/
2011-03-04 19:21:12 -06:00
Patrick Mezard
12049011b2 subrepo: handle svn tracked/unknown directory collisions
This happens more often than expected. Say you have an svn subrepository with
python code. Python would have generated unknown .pyc files. Now, you rebase
this setup on a revision where a directory containing python code does not
exist. Subversion is first asked to remove this directory when updating, but
will not because it contains untracked items. Then it will have to bring back
the directory after the merge but will fail because it now collides with an
untracked directory.

Using --force is not very elegant but it is much simpler than rewriting our own
purge command for subversion.
2011-03-04 14:00:49 +01:00
Steve Borho
9a4b1e24ec bookmark: fix invalidation of localrepo._bookmarkcurrent 2011-03-02 21:57:20 -06:00
Mads Kiilerich
25da754c3d revset: fix typo when assigning weight to reverse and limit 2011-02-24 00:47:49 +01:00
Adrian Buehlmann
d353d21e49 help: document branch template keyword
The branch keyword was added in 90d9a673aaed
2011-02-27 12:07:09 +01:00
Ry4an Brase
c7fa18ccc0 ui: always report untrusted hgrc files when debug enabled
It was suggested in IRC that people disabling the reporting of unstructed hgrc
files can masquerade as problems.  This makes sure untrusted hgrc files are
always reported if --debug is used.
2011-02-25 23:26:24 -06:00
Matt Mackall
8f5a9db068 context: be even more careful about result order in ancestors() (issue2642)
The earlier patch could be confused by more complicated topologies.
2011-02-25 15:31:32 -06:00
David Soria Parra
36125c089f bookmarks: restrict moving a bookmark to its descendants (issue1502)
A bookmark can only move to a descendant on commit, pull or
unbundle. Bookmarks cannot jump between heads anymore. This fixese
issue 1502.

We explicitly use new.node(), to emphasise that we are updating the
current bookmark to the new node.
2011-02-24 14:38:50 +01:00
Kevin Bullock
111736008c id: add bookmarks to id
Since bookmarks are no longer merged with repo.tags() as of
8e2d23f4bd25, they don't show up in `hg id` as they used to. This adds
them back into the summary that `hg id` prints, and adds a
-B/--bookmarks flag alongside the -t/--tags and -b/--branch options.

Note this introduces a slight backwards-incompatibility: the summary
printed by `hg id` now separates bookmarks from tags with a space, as
seen below, instead of running it into the tags list.

Default summary output:

  $ hg id
  db815d6d32e6 tip/tag1 bm1/bm2

Output with --bookmarks:

  $ hg id --bookmarks
  bm1 bm2

See also 5672c9e8202d which adds bookmarks back into `hg summary`.
2011-02-18 17:09:08 -06:00
Kevin Bullock
7c7c788a0e workingctx: overload bookmarks() to return parents' bookmarks
This implements workingctx.bookmarks() parallel to workingctx.tags(),
overloading the implementation from changectx.
2011-02-23 20:47:00 -06:00
Jonathan Nieder
be4a063fb7 backout: clarify which changesets are new in help text
Plus another wording tweak ("default behavior -> "behavior without
--merge").

Suggested by Kevin Bullock.
2011-02-11 21:17:27 -06:00
Martin Geisler
6d0223473c commands: update year to 2011 in version string 2011-02-25 11:39:19 +01:00
Martin Geisler
276fc6ed07 commands: mark strings for translation 2011-02-24 15:35:22 +01:00
Matt Mackall
7bcb1a26b9 context: generate file ancestors in reverse revision order (issue2642)
The related() function in copies assumes that revisions are generated
in reverse revision order, so it was getting confused in some situations.
2011-02-23 17:27:05 -06:00
Waqas Hussain
9981e2f9a8 export: only close files which export itself has opened 2011-02-23 13:21:55 +05:00
Eric Eisner
52f3c93dfa subrepo: only attempt pulling from git's origin
git fetch does not accept repository URLs as arguments, and the intended
logic of this code was not actually doing anything.
2011-02-23 10:59:36 -05:00
Eric Eisner
fc76e4918d subrepo: disallow all unknown git ref types 2011-02-23 10:17:44 -05:00
Adrian Buehlmann
b9288e15e7 sshrepo: catch passwords in ssh urls
see also d0162aaab5fc
2011-02-23 11:42:41 +01:00
Eric Eisner
16fbbf312c subrepo: expand relative sources for git subrepos 2011-02-22 15:11:10 -05:00
Jim Hague
e9a32b9ee1 changegroup: fix typo introduced in a6fa507d66ad 2011-02-22 16:31:01 +01:00
Mads Kiilerich
1203c4eaa3 changegroup: don't accept odd chunk headers 2011-02-22 03:10:37 +01:00
Mads Kiilerich
33712b2012 changegroup: verify all stream reads
Mercurial often failed with struct.error or mpatch.mpatchError if incomplete
data was received from a server.

Now we validate all changegroup reads and aborts with
  abort: stream ended unexpectedly (got %d bytes, expected %d)
if less than requested was read.
2011-02-22 03:03:39 +01:00
Mads Kiilerich
ff6d185655 changegroup: don't accept streams without proper termination
Streams should be terminated with a zero size changegroup, and read should
never be permitted to return less than requested.
2011-02-22 03:02:50 +01:00
Wagner Bruna
0d89e80dea rollback, i18n: avoid parameterized message 2011-02-21 20:58:54 -03:00
David Soria Parra
cfd53141e2 summary: add bookmarks to summary 2011-02-21 23:27:45 +01:00
David Soria Parra
2d34c64dae bookmarks: issue a warning if remote doesn't support comparing bookmarks
We want to issue a warning and abort comparing bookmarks if remote doesn't
support it. Otherwise hg out -B will list you outgoing bookmarks that cannot
be pushed to the remote repository using hg push -B.
2011-02-21 22:22:12 +01:00
David Soria Parra
d4d13da65d wireproto: catch possible cast error in pushkey
The server can return an unexpected answer like 'ssl required'. We catch those
possible cast errors and abort the operation.
2011-02-21 00:37:55 +01:00
David Soria Parra
fe7c493017 bookmarks: mark new bookmark as current if it points to the current dirstate
hg bookmark -r ancestorrev X will not mark X as the current bookmark anymore.
If you want to point a bookmark to a ancestor rev you will use hg update to
move to it. This will set the current bookmark.
2011-02-20 00:57:55 +01:00
Adrian Buehlmann
a8a418601f introduce new RequirementError (issue2649)
This improves the misleading error message

  $ hg identify
  abort: there is no Mercurial repository here (.hg not found)!

to the more explicit

  $ hg identify
  abort: requirement 'fake' not supported!

for all commands in commands.optionalrepo, which includes the identify
and serve commands in particular.

This is for the case when a new entry in .hg/requires will be defined
in a future Mercurial release.
2011-02-18 20:25:25 +01:00
Gilles Moris
dcdc58f0a5 rollback: clarifies the message about the reverted state (issue2628)
Previously, when rolling back a transaction, some users could be confused
between the level to which the store is rolled back, and the new parents
of the working directory.

  $ hg rollback
  rolling back to revision 4 (undo commit)

With this change:
  $ hg rollback
  repository tip rolled back to tip revision 4 (undo commit)
  working directory now based on revision 2 and 1

So now the user can realize that the store has been rolled back to an older
tip, but also that the working directory may not on the tip (here we are
rolling back the merge of the heads 2 and 1)
2011-02-10 09:03:06 +01:00
Mads Kiilerich
53a7e81f78 hgweb: handle invalid requests with both form data and querystring
Invalid requests could give an unhandled ErrorResponse.

Now this ErrorResponse is handled like other ErrorResponses so the client gets
an error message which also is logged on the server.
2011-02-21 00:57:19 +01:00
Mads Kiilerich
4a3ec69835 hgweb: give ErrorResponse a descriptive string/Exception representation
Very handy if the exception should appear in output.
2011-02-21 00:52:26 +01:00
Mads Kiilerich
c77a84761e serve: catch and log all Exceptions, not only StandardException
Other exceptions than StandardExceptions were left to the default error handler
which was muted when running in daemon mode.

Now all Exceptions are handled and logged to the log file.
2011-02-21 00:52:23 +01:00
Steve Borho
909958e650 match: fix subtle error in _buildmatch
The trailing comma was causing a ValueError.  See
https://bitbucket.org/tortoisehg/thg/issue/132
2011-02-18 10:28:20 -06:00
Mads Kiilerich
b6559c7bf6 statichttprepo: don't modify localrepo class variables
This happened to crash in subrepo setups when the base class variable was
modified twice.

Now we don't modify the class variable but an instance copy.
2011-02-18 23:41:13 +01:00
Mads Kiilerich
e4660104cf util: flush stdout before calling external processes
stdout could have content in its buffer while a subprocess ran and emitted
output.

Flushing stdout ensures that output now comes in the right order.
2011-02-18 03:35:01 +01:00
Oleg Stepanov
ee35622d91 Do not allow merging with uncommitted changes in a subrepo 2011-02-16 08:56:11 -08:00
Wagner Bruna
44bdaed8cd hgwebdir: reduce memory usage for index generation
The archive list generator was holding a reference to each
temporary ui copy passed by rawentries(), so the memory
usage for index generation growed proportionally to the
ui object size and the amount of repositories. By returning a
list instead, the temporary reference is dropped immediately.
2011-02-17 18:05:27 -02:00
Wagner Bruna
da9841899b pure: fix index parsing on empty repositories 2011-02-17 13:37:52 -02:00
Martin Geisler
d9e6fe01b4 subrepo: break long line found by check-code 2011-02-17 09:20:44 +01:00
Wagner Bruna
297638695f dispatch: fix typo in debug message 2011-02-16 21:02:41 -02:00
Kevin Bullock
720b543cad subrepos: print short git changeset ids
This changes the prompts on git subrepos to show only the first seven
digits of git changeset IDs (as git's command line does):

    $ hg update
    subrepository sources for s differ (in checked out version)
    use (l)ocal source (32a3438) or (r)emote source (da5f5b1)?
2011-02-16 11:53:48 -06:00
Adrian Buehlmann
82c4b3eebe store: remove pointless pathjoiner parameter
We can stop pretending that we have to support anything else
than '/' for concatenating path elements anywhere.

Windows deals just fine with '/' in file paths and we already
have plenty of places which produce paths containing '/'
anyway when running on Windows.
2011-02-16 15:02:30 +01:00
David Soria Parra
90a5744f74 bookmarks: forbid \0 \r \n : in bookmark names (BC)
We restrict : to 1. make it easer to convert bookmarks to git branches,
2. use : later for a syntax to push a local bookmark to a remote bookmark
of a different name. \0, \n, \r are fobbidden they are used to separate
bookmarks in the bookmark file.

This change breaks backward compatbility as ':' was an allowed character in
previous versions.
2011-02-16 18:36:45 +01:00
Mads Kiilerich
1edc9de542 url: merge BetterHTTPS with httpsconnection to get some proxy https validation 2011-02-16 04:36:36 +01:00
Mads Kiilerich
c7b145f8d2 url: always create BetterHTTPS connections the same way 2011-02-16 04:28:17 +01:00
Mads Kiilerich
ed367d71cf url: refactor BetterHTTPS.connect 2011-02-16 04:28:17 +01:00
Mads Kiilerich
6c8a377242 url: refactor _gen_sendfile 2011-02-16 04:28:17 +01:00
Mads Kiilerich
caabaf5584 url: remove test for self.ui in BetterHTTPS
We use self.ui unconditionally anyway so we would have noticed if it in some
cases wasn't set.
2011-02-16 04:28:17 +01:00
Erik Zielke
1d125c0477 subrepos: prompt on conflicts on update with dirty subrepos
Consider a repository with a single subrepository. The changesets in
the main repository reference the subrepository changesets like this:

  m0 -> s0
  m1 -> s1
  m2 -> s2

Starting from a state (m1, s0), doing 'hg update m2' in the main
repository will yield a conflict: the subrepo is at revision s0 but
the target revision says it should be at revision s2.

Before this change, Mercurial would do (m1, s0) -> (m2, s2) and thus
ignore the conflict between the working copy and the target revision.

With this change, the user is prompted to resolve the conflict by
choosing which revision he wants. This is consistent with 'hg merge',
which also prompts the user when it detects conflicts in the merged
.hgsubstate files.

The prompt looks like this:

  $ hg update tip
   subrepository sources for my-subrepo differ
  use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
2011-02-09 10:53:09 +01:00
David Soria Parra
12aa64e430 bookmarks: make track.current=True default behaviour and remove option (BC) 2011-02-16 01:29:26 +01:00
David Soria Parra
e0c062923b update: preserve possible bookmark name to set current bookmark correctly 2011-02-16 01:28:42 +01:00
Erik Zielke
2017770368 subrepo: remove argument introduced by mistake in e3640daa4703 2011-02-09 13:37:21 +01:00
Martin Geisler
4009f00b54 remove unnecessary list comprehensions
These result lists were only built for the side effects, and so a
normal loop is just as good and more straight-forward.
2011-02-03 10:31:17 +01:00
Patrick Mezard
1e4894d773 commit: abort if a subrepo is modified and ui.commitsubrepos=no
The default behaviour is to commit subrepositories with uncommitted changes. In
my experience this is usually undesirable:

- Changes to dependencies are often debugging leftovers
- Real changes should generally be applied on the source project directly,
  tested then committed. This is not always possible, subversion subrepos may
  include only a small part of the source project, without the tests.

Setting ui.commitsubrepos=no will now abort commits containing such modified
subrepositories like:

  $ hg --config ui.commitsubrepos=no ci -m msg
  abort: uncommitted changes in subrepo sub

I ruled out the hook solution because it does not easily take --include/exclude
options in account. Also, my main concern is whether this flag could cause
problems with extensions. If there are legitimate reasons for callers to
override this behaviour (I could not find any), they might either override at ui
level, or we could add an argument to localrepo.commit() later.

v2:
- Renamed ui.commitsubs to ui.commitsubrepos
- Mention the configuration entry in hg help subrepos
2011-02-15 22:25:48 +01:00
Adrian Buehlmann
76e8469c0d transaction: use posixfile and unlink from util
instead of open() and os.unlink()

Avoids potential issues with file access on Windows (e.g. AV-scanners).
2011-02-15 14:41:49 +01:00
Kevin Bullock
f9d396be75 bookmarks: update help text since moving into core
Clarifies the help text for the bookmarks command regarding the
requirements for pushing or pulling bookmarks.
2011-02-14 23:59:21 -06:00
jfh
48eb3f266f debugignore: catch the case when ignore.includepat doesn't exist
In testing of my recent addition of a debugignore command, some of my MacHg
users uncovered the exceptional case that if there is no ignore patterns of any
kind then a traceback occurred. Catch and fix this case.
2011-02-15 23:23:16 +13:00
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
Patrick Mezard
339c6194d0 subrepo: fix update -C with svn subrepos when cwd != repo.root 2011-02-01 21:39:28 +01:00
Yuya Nishihara
da93c3bd0b url: add --insecure option to bypass verification of ssl certificates
If --insecure specified, it behaves in the same way as no web.cacerts
configured.

Also shows hint for --insecure option when _verifycert() failed. But currently
the hint isn't displayed on SSLError, because it needs a certain level of
changes.
2011-01-29 23:23:24 +09:00
Erik Zielke
bf9e13d063 subrepo: make update -C clean the working directory for svn subrepos
This makes 'hg update --clean' behave the same way for both kinds of
subrepositories. Before Subversion subrepos did not take the clean
parameter into account, but just updated to the given revision and
merged uncommitted changes into that.
2011-01-31 13:33:41 +01:00
Mads Kiilerich
e10e504454 url: 'ssh known host'-like checking of fingerprints of HTTPS certificates
Known fingerprints of HTTPS servers can now be configured in the
hostfingerprints section. That makes it possible to verify the identify of web
servers without configuring and trusting the CA chain.

Limitations:
* Portnumbers are ignored, just like with ordinary certificates.
* Host name matching is case sensitive.
2011-01-28 02:57:59 +01:00
Adrian Buehlmann
f645c6e6fb opener: force copy on 'a'ppend if nlinks() returns 0 (issue1922)
If pywin32 is not installed, 'os.lstat(pathname).st_nlink' is used for
nlinks(), which is always zero for all files on Windows.

To make sure we break up hardlinks if pywin32 is missing, we force
nlink = 2 if nlinks() returns < 1.

(this completely fixes issue1922)
2011-01-26 19:14:30 +01:00
Patrick Mezard
afb494e2e2 subrepo: compare svn subrepo state to last committed revision
A subversion project revisions are a subset of the repository revisions, you
can ask subversion to update a working directory from one revision to another
without changing anything. Unfortunately, Mercurial will think the
subrepository has changed and will commit it again. To avoid useless commits,
we compare the subrepository state to its actual "parent" revision. To ensure
ascending compatibility with existing subrepositories which might reference
fake revisions, we also keep comparing with the subrepo working directory
revision.

NOTE: not sure if this should go in stable or not.
2011-01-22 16:15:40 +01:00
Steve Borho
f5cf898232 win32: win32console.GetStdHandle() can return None
When the Mercurial Python libraries are used within a Windows application with
no console, there is no stderr file handle.
2011-01-21 14:42:15 -06:00
Adrian Buehlmann
aef38e3838 remove pointless os.path.join calls when opening files in .hg/cache
Windows deals just fine with '/' in paths and Mercurial on Windows
already does file accesses elsewhere with mixed \ and / in file
paths anyway.

This patch also makes the static-http repo case use proper URLs of the
form

  http://example.com/repo/.hg/cache/branchheads
  http://example.com/repo/.hg/cache/tags

instead of the entirely pointless

  http://example.com/repo/.hg/cache%5Cbranchheads
  http://example.com/repo/.hg/cache%5tags

(as introduced by 5243ae377617)
2011-01-17 09:37:20 +01:00
Matt Mackall
286ea9ce04 merge with self 2011-02-01 17:53:50 -06:00
Patrick Mezard
15ac0306ee Merge with stable 2011-02-01 21:59:07 +01:00
Mads Kiilerich
0c2d4a2e7e merge with stable 2011-02-01 01:55:45 +01:00
Patrick Mezard
7700d1350b mq: factor out push conditions checks
Some extensions (e.g. hgsubversion) completely override push command. Because
extensions load order is unspecified, if hgsubversion loads before mq, mq
checks about not pushing applied patches will be bypassed. Short of finding a
way to fix load order, extracting the checking logic will allow
hgsubversion-like extensions to run the check themselves.
2011-01-31 22:16:33 +01:00
Matt Mackall
fa4133e7aa util: delay loading of textwrap 2011-01-28 17:02:29 -06:00
Mads Kiilerich
adb37b3b39 merge with stable 2011-01-28 03:09:22 +01:00
Matt Mackall
38d53c9ddd merge with stable 2011-01-27 17:22:37 -06:00
Matt Mackall
b4143e379a help: ssh urls don't allow passwords 2011-01-27 13:29:21 -06:00
Adrian Buehlmann
18144d9b0d commit: use the term SCM instead of RCS
for consistency.

see also da931fd0b5b6
2011-01-18 14:16:27 +01:00
Martin Geisler
a76e121863 backout of e4cb9628354c
Matt and a majority of crew did not like this approach.
2011-01-27 11:15:08 +01:00
Martin Geisler
d23e1973c2 specify C indention style using Emacs file local variables 2011-01-26 12:05:01 +01:00
Patrick Mezard
276b88543c Merge with stable 2011-01-22 16:29:10 +01:00
Steve Borho
fede5fa70d merge with stable 2011-01-22 09:13:04 -06:00
Matt Mackall
f549de8060 revlog: remove stray test in rev() 2011-01-21 16:26:01 -06:00
Benoit Boissinot
2feb9c3b6c merge with main 2011-01-20 20:35:54 +01:00
Matt Mackall
856c224de7 revlog: pass rev to _checkhash 2011-01-18 15:55:48 -06:00
Matt Mackall
275d2d9cb0 revlog: incrementally build node cache with linear searches
This avoids needing to prime the cache for operations like verify
which visit most or all of the index.
2011-01-18 15:55:46 -06:00
Adrian Buehlmann
6fa6b746ad opener: use util.unlink (issue2524) 2011-01-11 14:10:16 +01:00
Adrian Buehlmann
7f4eeda8e6 lock: use util.unlink (issue2537) 2011-01-11 14:10:16 +01:00
Adrian Buehlmann
c83b01e7a1 reintroduces util.unlink, for POSIX and Windows.
windows: factor it out of rename
posix: add alias 'unlink' for os.unlink

Note that this new unlink function now has different semantics than the
unlink() we had before changeset 5c424b3de62c ("rename util.unlink to
unlinkpath").
2011-01-11 14:10:16 +01:00
Adrian Buehlmann
236663ff4c opener: check exception for ENOENT 2011-01-11 14:10:16 +01:00
Adrian Buehlmann
f90344c20e windows.rename: check OSError for EEXIST
For example, if src has been opened with Python's open(), os.rename will
raise EACCES. Continuing in that case is pointless.
2011-01-11 14:10:16 +01:00
Yuya Nishihara
593388c52e url: check subjectAltName when verifying ssl certificate
Now it verifies certificate in the same manner as py3k implementation:
http://svn.python.org/view/python/branches/py3k/Lib/ssl.py?view=markup#match_hostname
2011-01-09 00:35:36 +09:00
Yuya Nishihara
ecde2415b3 url: fix UnicodeDecodeError on certificate verification error
SSLSocket.getpeercert() returns tuple containing unicode for 'subject'.
Since Mercurial does't support IDN at all, it just returns error for non-ascii
certname.
2011-01-08 21:52:25 +09:00
Adrian Buehlmann
3f7ac1d848 bundlerepo: use less intrusive util.posixfile to open bundle 2011-01-07 10:48:30 +01:00
Adrian Buehlmann
2226216a7c osutil: treat open modes 'w' and 'a' as 'w+' and 'a+' in posixfile
to work around http://support.microsoft.com/kb/899149.

Also, Microsoft's documentation of the CreateFile Windows API says (quote):

  When an application creates a file across a network, it is better to use
  GENERIC_READ | GENERIC_WRITE for dwDesiredAccess than to use
  GENERIC_WRITE alone. The resulting code is faster, because the
  redirector can use the cache manager and send fewer SMBs with more data.
  This combination also avoids an issue where writing to a file across a
  network can occasionally return ERROR_ACCESS_DENIED.
2011-01-15 23:54:01 +01:00
Kevin Bullock
356b5c3414 subrepo: clarify comments in dirty() methods
Just a little change to bring the comments in the dirty() methods of the
various subrepo classes into a uniform structure. This clarifies the
meaning of the states checked.
2011-01-04 10:42:00 -06:00
Erik Zielke
68282c3062 subrepo: make update -C clean the working directory for git subrepos
This makes 'hg update --clean' behave the same way for all three kinds
of subrepositories [hg, svn, git]. Before git subrepos did not take
the clean parameter into account, but just updated to the given
revision and merged uncommitted changes into that.
2011-01-31 13:40:05 +01:00
Martin Geisler
17df79113a merge with stable 2011-01-31 13:38:00 +01:00
Oleg Stepanov
501d7926e8 subrepo: do not report known files inside repositories as unknown 2011-01-04 03:53:11 -08:00
jfh
a52d7e5744 move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
The generation of cache files like tags.cache and branchheads.cache is not an
actual reflection of things changing in the whole of the .hg directory (like eg
a commit or a rebase or something) but instead these cache files are just part
of bookkeeping. As such its convienant to allow various clients to ignore file
events to do with these cache files which would otherwise cause a double
refresh. Eg one refresh might occur after a commit, but the act of refreshing
after the commit would cause Mercurial to generate a new branchheads.cache which
would then cause a second refresh, for clients.

However if these cache files are moved into a directory like eg .hg/cache/ then
GUI clients on OSX (and possibly other platforms) can happily ignore file events
in this cache directory.
2011-01-04 06:29:08 +01:00
Benoit Boissinot
9d61e1d978 addchangegroup: document the current locking semantics 2011-01-16 17:26:34 +01:00
Benoit Boissinot
8acffa3308 revlog: explicit test and explicit variable names 2011-01-16 12:25:46 +01:00
Benoit Boissinot
3ada8fe22e revlog: if the nodemap is set, use the fast version of revlog.rev() 2011-01-16 12:24:48 +01:00
Benoit Boissinot
383d62511b revlog/parseindex: construct the nodemap if it is empty 2011-01-15 15:06:53 +01:00
Benoit Boissinot
4072e97b7c revlog: always add the magic nullid/nullrev entry in parseindex 2011-01-15 13:02:19 +01:00
Benoit Boissinot
b75c111431 revlog/parseindex: no need to pass the file around 2011-01-15 15:04:58 +01:00
Benoit Boissinot
6c18ebff9d parsers.c: fix comment 2011-01-15 12:44:28 +01:00
Matt Mackall
3d98b5db9a pure: update index parsing 2011-01-12 13:54:39 -06:00
Matt Mackall
1e3dbac7f5 revlog: do revlog node->rev mapping by scanning
Now that the nodemap is lazily created, we use linear scanning back
from tip for typical node to rev mapping. Given that nodemap creation
is O(n log n) and revisions searched for are usually very close to
tip, this is often a significant performance win for a small number of
searches.

When we do end up building a nodemap for bulk lookups, the scanning
function is replaced with a hash lookup.
2011-01-11 21:52:03 -06:00
Matt Mackall
a1c37f5749 revlog: introduce a cache for partial lookups
Partial lookups are always O(n), and often we look up the same
one multiple times.
2011-01-11 17:12:32 -06:00
Matt Mackall
148e99b0ed tags: avoid a pointless usage of revlog.nodemap 2011-01-11 17:09:06 -06:00
Matt Mackall
846d35e24f revlog: only build the nodemap on demand 2011-01-11 17:01:04 -06:00
Matt Mackall
efaaee2894 revlog: remove lazy index 2011-01-04 14:12:52 -06:00
Mads Kiilerich
e45cfbe202 merge with stable 2011-01-11 02:48:58 +01:00
Patrick Mezard
6f893497c0 mail: fix regression when parsing unset smtp.tls option 2011-01-07 20:50:42 +01:00
Kevin Bullock
e69254e948 subrepo: fix svnsubrepo.dirty() checking of ignoreupdate (issue2499)
The ignoreupdate flag to subrepo.dirty(), introduced in 55e4073493fc, is
correctly checked with this change.
2011-01-04 11:33:47 -06:00
Matt Mackall
06f318150a filelog: move metadata parsing to a helper function 2011-01-06 17:04:47 -06:00
Matt Mackall
a399da7502 revlog: break hash checking into subfunction 2011-01-06 17:04:41 -06:00
Matt Mackall
2a8c2e15b4 ui: add configpath helper 2011-01-06 17:04:33 -06:00
Eduard-Cristian Stefan
c66ec9cf09 url: expand path for web.cacerts 2011-01-02 15:30:12 +02:00
Martin Geisler
d2eec2cbbc commands: clarify which aliases "hg help -v" show (issue2572) 2011-01-05 10:47:35 +01:00
Adrian Buehlmann
721e368ac1 rename util.unlink to unlinkpath 2011-01-02 19:34:41 +01:00
Martin Geisler
dc8a50e193 merge with stable 2011-01-05 15:56:03 +01:00
Matt Mackall
49ec3df937 merge with stable 2011-01-01 18:42:04 -06:00
Yuya Nishihara
7e36de64c5 util: fix ellipsis() not to break multi-byte sequence (issue2564)
It tries to convert localstr to unicode before truncating.
Because we cannot assume that the given text is encoded in local encoding,
it falls back to raw string in case of unicode error.
2010-12-25 21:59:00 +09:00
Matt Mackall
e6a9c922d9 hgweb: abort if config file isn't found 2010-12-29 15:23:16 -06:00
Matt Mackall
6b199f1d8d date: fix matching of underspecified date ranges
(backport of 7bca0f2718ab to stable)
2010-12-29 14:19:31 -06:00
Adrian Buehlmann
bfc33d780a windows.rename: eliminate temp name race (issue2571)
On Windows, os.rename reliably raises OSError with errno.EEXIST if the
destination already exists (even on shares served by Samba).

Windows does *not* silently overwrite the destination of a rename.

So there is no need to first call os.path.exists on the chosen temp path.

Trusting os.path.exists is actually harmful, since using it enables the
following racy sequence of actions:

 1) os.path.exists(temp) returns False
 2) some evil other process creates a file with name temp
 3) os.rename(dst, temp) now fails because temp has been taken

Not using os.path.exists and directly trying os.rename(dst, temp)
eliminates this race.
2010-12-27 01:12:31 +01:00
Steve Borho
5d527f9378 match: support reading pattern lists from files 2010-12-23 15:12:24 -06:00
Matt Mackall
f6fde7c0c9 merge with stable 2010-12-29 15:31:25 -06:00
Matt Mackall
8946a77df1 date: fix matching of underspecified date ranges
In a date like 10:30, there are two underspecified ends: the specific
end (seconds) and the broad end (day, month, year). When matching
"10:30", we need to allow the specific end to go from 0 to 59 seconds,
while the broad end is assumed to be today's date.

Similar handling applies for a date range like "Mar 1": year is fixed
to today, any time matches.
2010-12-29 14:04:47 -06:00
Matt Mackall
68fbaea0de merge with stable 2010-12-29 11:18:27 -06:00
Dan Villiom Podlaski Christiansen
83b3b076d6 hooks: sort any dictionaries set in the environment
The actual order of dictionary items is implementation-defined in
Python, and differs between CPython and PyPy. With this change,
test-hooks.t passes with PyPy.
2010-12-24 15:22:00 +01:00
Matt Mackall
ceea1a202f merge with stable 2010-12-28 13:31:30 -06:00
Zhigang Wang
5376237d45 smtp: fix for server doesn't support starttls extension
Currently we only support enabling TLS by using SMTP STARTTLS extension. But
not all the servers support it.

With this patch, user can choose which way to enable TLS:

* Default:

      tls = none
      port = 25

* To use STARTTLS:

      tls = starttls
      port = 465

* To use SMTP over SSL:

      tls = smtps
      port = 465

To keep backward compatibility, when tls = true, we use STARTTLS to enable TLS.

Signed-off-by: Zhigang Wang <w1z2g3@gmail.com>
2010-12-20 16:56:54 +08:00
Adrian Buehlmann
942d5fa3d6 checknlink: use two testfiles (issue2543)
Preventing file loss repository corruption (e.g. vanished changelog.i) when
Mercurial pushes to repositories on Windows shares served by Samba.

This is a workaround for Samba bug 7863, which is present in current latest
stable Samba 3.5.6 and various prior versions down to 3.0.26a (the oldest one
I tested).

Of course this should be fixed in Samba, but there probably aren't that many
other applications who use hardlinks that extensively and keep files open like
Mercurial, so the pressure to fix this on Samba is probably not that high. And
even if the Samba project should be able to fix their bug within a month or
two, it will take quite some time until users upgrade their Samba installs.
2010-12-13 22:38:06 +01:00
John Peberdy
2b3c69e04a help: correct documentation for branches keyword 2010-12-19 21:49:54 -05:00
Mads Kiilerich
d9f11887ef https: use web.cacerts configuration from local repo to validate remote repo 2010-12-27 17:49:58 +01:00
Steve Borho
8562094eb1 util: concentrate quoting knowledge to windows.py quotecommand()
This fixes all callers of util.quotecommand() and place special knowledge
of the bugfix in 2.7.1 in a single platform specific place.
2010-12-22 13:25:00 -06:00
Matt Mackall
64de41cf08 url: fix trailing whitespace 2010-12-20 15:26:36 -06:00
Adrian Buehlmann
9638578b5c fncachestore: copy dh directory before the manifest
Before this patch, the copy order on clone was:

  requires
  00changelog.i
  store\data
  store\00manifest.d
  store\00manifest.i
  store\00changelog.d
  store\00changelog.i
  store\dh
  store\fncache

Which provides a theoretical non-zero probability of a race during clone where
a very early reader might see a repository with missing revlog files if it sees
00changelog.i before all files inside dh have been copied.

The dh directory is similar to the data directory -- just for files with long
names (which are hashed). The manifest refers to files in data *and* dh, so dh
should be copied before the manifest.

This patch improves the copy order to:

  requires
  00changelog.i
  store\data
  store\dh
  store\fncache
  store\00manifest.d
  store\00manifest.i
  store\00changelog.d
  store\00changelog.i

I'm putting fncache to before the manifest while I'm at it, since fncache
provides a mechanism to enumerate all repository files without visiting the
manifest revisions. fncache depends only on data and dh.

Note that data must be copied first, since copying data triggers the creation
of the repository write lock in the destination repo (see hg.clone).
2010-12-17 10:40:26 +01:00
Mads Kiilerich
97213d6b00 https: warn when server certificate isn't verified
Mercurial will verify HTTPS server certificates if web.cacerts is configured,
but it will by default silently not verify any certificates.

We now warn the user that when the certificate isn't verified she won't get the
security she might expect from https:
  warning: localhost certificate not verified (check web.cacerts config setting)

Self-signed certificates can be accepted silently by configuring web.cacerts to
point to a suitable certificate file.
2010-12-18 21:58:52 +01:00
Kevin Bullock
6d031e2cdb tag: abort if not at a branch head (issue2552)
Since it's usually only desirable to make tag commits on top of branch
heads, abort if the working dir parent is not a branch head. -f/--force
may be passed to commit at a non-head anyway.

Does not abort if working dir parent is a named branch head but not a
topological head.
2010-12-06 22:04:10 -06:00
Kevin Bullock
90e6b3e885 tag: fix uncommitted merge check and error message (issue2542)
This patch corrects the check for tagging on an uncommitted merge. We
should never commit a new tag changeset on an uncommitted merge, whether
or not --rev is specified. It also changes the error message from:

  abort: cannot partially commit a merge (do not specify files or patterns)

to the much more accurate (and terse):

  abort: uncommitted merge

Local tags are ok.
2010-12-07 08:02:54 +01:00
Kevin Bullock
85d737621f tag: don't check .hgtags status if --local passed
Local tags don't create a commit, so we don't need to check the status
of .hgtags.
2010-12-13 21:20:30 -06:00
Steve Borho
1493f6fe1b util: work around behavior change in Python 2.7.1 2010-12-13 11:51:01 -06:00
Matt Mackall
be1d11e804 hook: fix import path handling for repo=None 2010-12-10 19:18:02 -06:00
Alexander Solovyov
e86de517fe hook: assume relative path to hook is given from repo root 2010-12-07 15:27:04 +01:00
Matt Mackall
eec34ddf7c subrepo: backed out changeset 9ce26f91f137 2010-12-10 19:08:17 -06:00
Mads Kiilerich
9933c7a60f subrepo: initialize subrepo relative default paths relative to their root 2010-12-10 01:30:16 +01:00
Brodie Rao
08a14dad90 archival: don't set gzip filename header when there's no filename
This mainly affects hgweb, which can generate tar.gz archives without
filenames. Without this change, the header would be set to ".gz",
which can confuse Safari into extracting the file and renaming it to
"gz" when "Open 'safe' files after downloading" is enabled.

file(1) before:

hg-crew-439421eab08d.tar.gz: gzip compressed data, was ".gz", last modified: Thu Dec  2 11:46:20 2010, max compression

after:

hg-crew-439421eab08d.tar.gz: gzip compressed data, last modified: Thu Dec  2 11:46:20 2010, max compression
2010-12-07 19:47:53 +11:00
Patrick Mezard
744f417d4c patch: write .rej files without rewriting EOLs
Do not pass reject file content to patchfile.writelines() to:
- Avoid line endings transformations
- Avoid polluting overriding implementations with unrelated data. They should
  override write_rej() to deal or ignore reject files properly.

Bug report, analysis and original patch and test by
Shun-ichi GOTO <shunichi.goto@gmail.com>
2010-12-03 11:40:30 +09:00
David Soria Parra
e107057815 avoid .split() in for loops and use tuples instead
split can be more readable for longer lists like the list in
dirstate.invalidate. As dirstate.invalidate is used in wlock() and therefoe
used heavily, I think it's worth avoiding a split there too.
2010-12-02 03:43:06 +01:00
Oli Thissen
19beab3bf6 hgweb: added revision date to annotate line data
The only revision information yielded by the annotate view was the revision
number itself. The patch allows the use of per-line revision dates in the
corresponding templates.
2010-12-06 16:56:06 +01:00
Jim Hague
e572ae4bd8 opener: forbid paths ending with directory separator (issue2507)
If Linux is asked to open a filename with a trailing directory separator,
e.g. "foo/", the open fails with EISDIR. On AIX, the open succeeds, opening
file "foo". This causes test-mq-qnew to fail on AIX.

Fix by adding 'ends with directory separator' to the conditions checked
by the path auditor. Change test to expect auditor fail message.
2010-12-17 12:05:45 +00:00
Mads Kiilerich
2f015848bf merge with stable 2010-12-27 17:54:45 +01:00
Mads Kiilerich
b89ce1b270 extensions: warn about invalid extensions when listing disabled commands
Invalid extensions in hgext/ could in some cases cause a crash when searching
for unknown commands in disabled extensions.

With this change we issue a warning if extracting commands from the extensions
fails. Traceback is available on request.

Reported on https://bugzilla.redhat.com/show_bug.cgi?id=663183 with forest.py.
2010-12-26 00:43:49 +01:00
Steve Borho
cd3b55bab4 merge with stable 2010-12-23 13:23:20 -06:00
Matt Mackall
a892ad5a23 templater: clarify engine caching 2010-12-22 13:16:03 -06:00
Eric Eisner
5a68596380 subrepo: basic support for status of git subrepos 2010-12-20 13:59:33 -05:00
Eric Eisner
ca54cd3a42 subrepo: fix subrelpath for git subrepos
This patch conforms gitsubrepo code to the variable naming scheme of the other
subrepo implementations. All user-facing path references should be relative
to the root repository.
2010-12-20 13:59:33 -05:00
Eric Eisner
ec2e32efb2 subrepo: fix git archive parsing of directories and symfiles 2010-12-20 13:59:33 -05:00
Eric Eisner
056bbfc80f subrepo: support ignoreupdate in gitsubrepo's dirty() 2010-12-20 13:59:33 -05:00
Eric Eisner
c6b2baa3dd subrepo: backout 4f4b977c5189
Unfortunately git 1.6 does not support the upstream parameter in for-each-ref.
2010-12-20 13:59:19 -05:00
Matt Mackall
86bd49d7fc url: fix check-code whitespace complaint 2010-12-20 12:12:18 -06:00
Matt Mackall
0b9296f805 templater: use the parser.py parser to extend the templater syntax 2010-12-20 12:09:00 -06:00
Matt Mackall
39437f5a68 templater: give slightly nicer error for unknown map entries 2010-12-20 12:09:00 -06:00
Kevin Bullock
5c61f5f136 mq: update .hgsubstate if subrepos are clean (issue2499)
This patch prevents MQ from creating an inconsistent subrepo state. If
the .hgsub file has been changed, and none of the subrepos have
uncommitted changes, creating or updating a patch (using qnew, qrefresh,
or qrecord) will update .hgsubstate accordingly.

If any subrepos _do_ have uncommitted changes, qnew/qrefresh/qrecord
will abort.

Thanks to pmezard for proposing this solution.
2010-12-07 22:14:43 -06:00
Erik Zielke
d12bb06bf6 subrepo: backout 9f2d8e1439d7
backing out 9f2d8e1439d7 because it introduced a bug in
.hgsubstate handling.
2010-12-17 13:38:15 +01:00
Matt Mackall
02e03e68fb merge with stable 2010-12-20 12:08:50 -06:00
Mads Kiilerich
298ff06c2d merge with stable 2010-12-18 22:06:11 +01:00
Greg Ward
885d349b11 merge: document some internal return values. 2010-12-13 11:46:31 -05:00
Matt Mackall
cdcb8c0f47 check-code: catch "except as" 2010-12-16 14:50:36 -06:00
Mads Kiilerich
9772d9af5a merge: fast-forward merge with descendant
issue2538 gives a case where a changeset is merged with its child (which is on
another branch), and to my surprise the result is a real merge with two
parents, not just a "fast forward" "merge" with only the child as parent.

That is essentially the same as issue619.

Is the existing behaviour as intended and correct?

Or is the following fix correct?

Some extra "created new head" pops up with this fix, but it seems to me like
they could be considered correct. The old branch head has been superseeded by
changes on the other branch, and when the changes on the other branch is merged
back to the branch it will introduce a new head not directly related to the
previous branch head.

(I guess the intention with existing behaviour could be to ensure that the
changesets on the branch are directly connected and that no new heads pops up
on merges.)
2010-12-07 03:29:21 +01:00
Eric Eisner
8113ebb989 template: add showbranch template for {branch}
Like showbranches, but always yields exactly one branch. Replaces the less
correct {branches|nonempty}.
2010-12-13 10:30:15 -05:00
Adrian Buehlmann
31d1e36f3f makedirs: abort if parent == name (issue2531)
catches unknown drive letters on Windows
2010-12-01 21:15:31 +01:00
Erik Zielke
19fa82cefe subrepo: avoids empty commit when .hgsubstate is dirty (issue2403)
This patch avoids empty commit when .hgsubstate is dirty. Empty commit
was caused by .hgsubstate being updated back to the state of the
working copy parent when committing, if a user had changed it manually
and not made any changes in subrepositories.

The subrepository state from the working copies parent is compared
with the state calculated as a result of trying to commit the
subrepositories. If the two states are the same, then return None
otherwise the commit is just done.

The line: "committing subrepository x" will be written if there is
nothing committed, but .hgsubstate is dirty for x subrepository.
2010-11-29 09:37:23 +01:00
Eric Eisner
06990b8d8e subrepo: use low-level git-diff-index for dirty()
Despite its name, git-diff-index compares a revision to the files in the
working directory. This seems way less sketchy and more future proof than
parsing human-readable git-status.
2010-12-14 21:58:13 -05:00
Eric Eisner
1e1100a33b subrepo: defer determination of git's current branch 2010-12-14 21:56:43 -05:00
Eric Eisner
2c85454675 subrepo: incorporate tracking branches into gitbranchmap 2010-12-14 21:56:43 -05:00
Eric Eisner
26d7ede580 subrepo: use low-level git-for-each-ref command in branchmap
This command's output doesn't change across versions, and it also
disambiguates cases where there are slashes in local branch names.
2010-12-14 21:53:40 -05:00
Martin Geisler
290569c6d1 subrepo: add progress bar support to archive 2010-11-29 16:34:10 +01:00
Martin Geisler
70d929229e archive: add support for progress extension 2010-11-29 16:17:05 +01:00
Matt Mackall
4866a8eb9e subrepo: re-backout 9ce26f91f137
This bug got introduced into default simultaneously with its backout,
so future merges didn't eradicate it.
2010-12-14 18:10:51 -06:00
Matt Mackall
fbcb895f80 merge with stable 2010-12-14 17:10:01 -06:00