Commit Graph

7521 Commits

Author SHA1 Message Date
Idan Kamara
b9dc5b5bf7 dispatch: use the request to store the ui object
and check if we got one before creating.

note that the contents of the ui object might change after
dispatch() returns (by options passed through --config for example),
to ensure it doesn't, pass a copy() of it.
2011-05-26 00:53:23 +03:00
Idan Kamara
5544ef8f07 dispatch: wrap dispatch related information in a request class
currently only stores the arguments.
2011-05-26 00:44:11 +03:00
Steven Brown
b13eee65a4 patch: restore the previous output of 'diff --stat'
Restore the previous diffstat behaviour of scaling by the maximum number of
changes to a single file. Changeset 7bb0e22a7988 modified the diffstat to be
scaled by the total number of changes. This seems to have been unintentional.
2011-05-26 22:51:02 +08:00
Peter Arrenbrecht
8761d1fa87 wireproto: enable optional args for known() for future extensibility
Firstly, I think we should do this for all new wire commands, just
to be on the safe side. So I want to get this into the 1.9 release.

Secondly, there actually is potential here that sometimes the server
can know that the number of its nodes which can possibly still be
undecided on the client is small. It might then just send them along
directly (cutting short the end game). This, however, requires
walking the graph on the server, which can be expensive, so for the
moment we're not actually doing it.
2011-05-24 17:48:16 +02:00
Matt Mackall
c6e850b04b context: make forget work like commands.forget
Switch users of wctx.delete(..., False) to forget.
2011-05-26 17:15:35 -05:00
Matt Mackall
97c6e7b48d dirstate: rename forget to drop
It has substantially different semantics from forget at the command
layer, so change it to avoid confusion.

We can't simply combine it with remove because we need to explicitly
drop non-added files in some cases like commit.
2011-05-26 17:15:35 -05:00
Martin Geisler
ce8ced9777 minirst: read test input from stdin 2011-05-26 10:46:34 +02:00
Matt Mackall
a8dec32fed httprepo: handle large lengths by bypassing the len() operator 2011-05-24 17:30:00 -05:00
Adrian Buehlmann
5872a76fa2 workingctx.remove: don't stat files again after unlinking
we already know at this point that they have been unlinked
2011-05-24 14:52:23 +02:00
Matt Mackall
438f823709 httprepo: send URL redirection notices to stderr (issue2828) 2011-05-24 17:16:31 -05:00
Augie Fackler
14a08e5514 pure parsers: properly detect corrupt index files
This new Python code should be equivalent in behavior to the if
statement at line 312 of parsers.c. Without this, the pure-python
parsers improperly ignore truncated revlogs as created in
test-verify.t.
2011-05-24 13:30:10 -05:00
Adrian Buehlmann
2fa6cdd315 workingctx: unlink paths while holding the wlock 2011-05-24 14:08:20 +02:00
Martin Geisler
34dddcd6fe wireproto: do not hash when heads == ['force']
Changeset 20b319765bcf introduced the unbundlehash capability and
unconditionally hashed the heads on the client side. By mistake, the
heads were also cased in the heads == ['force'] case.
2011-05-24 16:12:01 +02:00
Patrick Mezard
32250cd067 patch: remove EOL support from linereader class
This was only used when reading patched files which is now done by backends.
2011-05-24 14:21:04 +02:00
Matt Mackall
db4e14bfa3 subrepo: handle local added subrepo case correctly 2011-05-23 22:49:10 -05:00
Idan Kamara
d5c206ffa2 extensions: raise when trying to find an extension that failed to load
extensions that depend on other extensions (such as record) use this pattern
to check if the dependant extension is available:

    try:
        mq = extensions.find('mq')
    except KeyError:
        return

but since if an error occurs while loading an extension it leaves its entry
in the _extensions map as None, we want to raise in that situation too.

(rather than adding another check if the return value is None)
2011-05-23 23:09:00 +03:00
Adrian Buehlmann
f559c2bcbb remove: clarify help text about added files never being deleted from disk 2011-05-23 15:56:31 +02:00
Adrian Buehlmann
8728d73db7 pure: provide more correct implementation of posixfile for Windows
requires ctypes

Why is posixfile a class?

Because the implementation needs to use the Python library call os.fdopen [1],
which sets the 'name' attribute on the Python file object it creates to the
mostly meaningless string '<fdopen>', since file descriptors don't have a name.

But users of posixfile depend on the name attribute [2] being set to a proper
value, like Python's built-in 'open' function sets it on file objects.

Python file's name attribute is read-only, so we can't just assign to it after
the file object has alrady been created.

To solve this problem, we save the name of the file on a wrapper object,
and delegate the file function calls to the wrapped (private) file object
using __getattr__.

[1] http://docs.python.org/library/os.html#os.fdopen
[2] http://docs.python.org/library/stdtypes.html#file.name
2011-05-18 09:12:27 +02:00
Peter Arrenbrecht
fedeff28a1 bundlerepo: make getremotechanges support filtering of incoming
Extensions can hook discovery.findcommonincoming to filter out unwanted remote
changesets. This patch makes getremotechanges respect the changed remote heads
returned by such extensions.
2011-05-23 20:35:10 +02:00
Adrian Buehlmann
a11d19c5ad applyupdates: audit merged files
protects changing flags on merged files (util.setflags call on line 341)
2011-05-22 11:03:15 +02:00
Adrian Buehlmann
18e5c7b1c9 applyupdates: audit path on flag changes
we're using the auditor of the repo wopener, since this is a path that belongs
to the tree we're updating to
2011-05-21 23:21:12 +02:00
Adrian Buehlmann
60c5ff105b opener: add audit function 2011-05-21 23:13:59 +02:00
Matt Mackall
0842cf2d1e templatekw: use diffstatsum in diffstat keyword 2011-05-21 15:09:15 -05:00
Matt Mackall
6af03bc2e8 patch: use diffstatsum in diffstat 2011-05-21 15:06:38 -05:00
Matt Mackall
7560e9a576 patch: add diffstatsum helper 2011-05-21 15:06:36 -05:00
Matt Mackall
898e0ce783 diffstatdata: no longer a generator
This produces a smallish amount of data and all consumers needed to
buffer it anyway.
2011-05-21 15:01:28 -05:00
Adrian Buehlmann
9e0713e79c add new option --all to manifest command
prints a list of all files in all revisions of the repo

obsoletes the cifiles extension
2011-05-18 21:31:40 +02:00
Adrian Buehlmann
4c8d0e46fa applyupdates: audit unlinking of renamed files and directories 2011-05-21 02:05:00 +02:00
Matt Mackall
66805ccfed revlog: stop exporting node.short 2011-05-21 15:01:28 -05:00
Patrick Mezard
272081b65d patch: fast-path git case in selectfile()
We avoid a lot of complicated heuristics in git cases, where these heurestics
may even be broken when copies are involved.
2011-05-19 22:55:13 +02:00
Patrick Mezard
a09607c9ee patch: unify backend file access interface
- Rename readlines() into getfile(), return data and mode
- Make setfile() write a data buffer instead of lines, make mode mandatory.
2011-05-19 22:49:43 +02:00
Patrick Mezard
701e9571f9 patch: merge backend setmode() into writelines()
Copy handling will be easier to handle in a single method.
2011-05-19 22:44:01 +02:00
Patrick Mezard
15861c0232 patch: stop modifying gitpatch objects
gitpatch objects emitted by iterhunks() were referencing file paths unmodified
from the input patch. _applydif() made them usable by modifying the gitpatch
objects in-place with specified path strip level. The same modified objects
were then reused by iterhunks() generator. _applydiff() now copies and update
the paths which completely decouples both routines.

As a side effect, the "git" event now receives only metadata about
copies/renames to perform the necessary copies ahead of time. Other actions are
handled in the "file" event.
2011-05-19 22:44:01 +02:00
Patrick Mezard
3246b5c773 patch: stop handling hunkless git blocks out of stream
Patch changes are emitted by iterhunks() in two separate events: 'file' when
hunks have to be applied and 'git' to describe other modifications like copies
or mode changes. Note that a file which mode is changed and which content is
modified by the same patch will be emitted in both events. It is more
convenient to handle all file modifications in a single event. This patch
"zips" git actions with regular changes so both kinds can be emitted at the
same place.
2011-05-19 22:44:01 +02:00
Patrick Mezard
ac0634bc33 patch: reindent code 2011-05-19 22:44:01 +02:00
Patrick Mezard
ac6f56515a patch: unify iterhunks() afile/bfile handling
git afile/bfile are extracted twice, once when reading a 'diff --git', and
again when reading a unified hunk. The problem is not all git blocks have
unified hunks (renames just have metadata) and they were not extracted the same
way. This is what this patch unifies.
2011-05-19 22:44:01 +02:00
Patrick Mezard
f8df1dcc42 patch: git metadata was ignored if strip > 1
gitpatch objects emitted by iterhunks() are modified in place by applydiff().
Processing them earlier improves iterhunks() isolation. applydiff() modifying
them should still be fixed though.
2011-05-19 22:44:01 +02:00
Patrick Mezard
68fd0dcbe7 patch: construct and parse binary hunks at the same time 2011-05-19 22:44:01 +02:00
Patrick Mezard
452fad17b8 patch: refactor iterhunks() regular and binary files emission 2011-05-19 22:44:01 +02:00
Patrick Mezard
78738c3822 patch: remove patch.patch() cwd argument 2011-05-19 22:44:01 +02:00
Patrick Mezard
6d4d079b0e patch: merge _updatedir() into externalpatch() 2011-05-19 22:44:01 +02:00
Martin Geisler
0eaeed4412 merge with stable 2011-05-19 18:10:03 +02:00
Martin Geisler
ff9aae8a76 changelog: convert user and desc from local encoding early
Failing to do so makes it impossible to use the memctx API to create a
changeset with a commit message or username outside of the current
encoding.encoding setting.
2011-05-19 18:09:25 +02:00
Martin Geisler
142cf677cd merge crew with main 2011-05-19 16:57:14 +02:00
Brendan Cully
b1b428c2d8 clone: make default path absolute for all local paths
This fixes the default path when cloning local repositories with hg-git, since
hg-git cancopy() is false even for local repositories.
2011-05-18 23:20:26 -07:00
Patrick Mezard
2bda8cbde2 patch: add a workingbackend dirstate layer on top of fsbackend
_updatedir() is no longer used by internalpatch()

The change in test-mq-missingfiles.t comes from workingbackend not considering
the missing 'b' file as changed, thus not calling addremove() on it.
2011-05-18 23:48:17 +02:00
Patrick Mezard
34a629b9c0 patch: handle binary copies as regular ones
This introduces a performance regression for large files, as they will be
copied just to be clobbered afterwards since binary patching does not use
deltas.  But it simplifies the code and the previous optimization will be
reintroduced later in a better way.
2011-05-18 23:48:13 +02:00
Patrick Mezard
18202a57db patch: remove files while patching, not in updatedir()
At this point, updatedir() only reads the working directory and update the
dirstate.
2011-05-18 23:48:13 +02:00
Patrick Mezard
514ff73602 patch: set desired mode when patching, not in updatedir()
This patch and the following aim at merging _updatedir() actions into
_applydiff().
2011-05-18 23:48:13 +02:00
Patrick Mezard
e5afef2782 patch: stop changing current directory before patching
_applydiff() patcher argument was added to help hgsubversion like extension
monkeypatching the patching process. While it could be removed at this point, I
prefer to leave it until patch.py is completely refactored and there is a valid
and tested alternative.
2011-05-18 23:48:13 +02:00