Commit Graph

14586 Commits

Author SHA1 Message Date
Patrick Mezard
51439bc0e1 run-tests: fix --blacklist (broken by 098f69771978) 2011-05-28 11:44:27 +02:00
Patrick Mezard
ab82a700d3 patch: do not patch unknown files (issue752) 2011-05-27 21:50:11 +02:00
Patrick Mezard
d4b7db6294 patch: use temporary files to handle intermediate copies
git patches may require copies to be handled out-of-order. For instance, take
the following sequence:

  * modify a
  * copy a into b

Here, we have to generate b from a before its modification. To do so,
applydiff() was scanning for copy metadata and performing the copies before
processing the other changes in-order. While smart and efficient, this approach
complicates things by handling file copies and file creations at different
places and times. While a new file must not exist before being patched a copied
file already exists before applying the first hunk.

Instead of copying the files at their final destination before patching, we
store them in a temporary file location and retrieve them when patching. The
filestore always stores file content in real files but nothing prevents adding
a cache layer. The filestore class was kept separate from fsbackend for at
least two reasons:

- This class is likely to be reused as a temporary result store for a future
  repository patching call (entries just have to be extended to contain copy
  sources).

- Delegating this role to backends might be more efficient in a repository
  backend case: the source files are already available in the repository itself
  and do not need to be copied again. It also means that third-parties backend
  would have to implement two other methods. If we ever decide to merge the
  filestore feature into backend, a minimalistic approach would be to compose
  with filestore directly. Keep in mind this copy overhead only applies for
  copy/rename sources, and may even be reduced to copy sources which have to
  handled ahead of time.
2011-05-27 21:50:10 +02:00
Patrick Mezard
e6f284be06 patch: refactor file creation/removal detection
The patcher has to know if a file is being created or removed to check if the
target already exists, or to actually unlink the file when a hunk emptying it
is applied. This was done by embedding the creation/removal information in the
first (and only) hunk attached to the file.

There are two problems with this approach:

- creation/removal is really a property of the file being patched and not its
  hunk.

- for regular patches, file creation cannot be deduced at parsing time: there
  are case where the *stripped* file paths must be compared. Modifying hunks
  after their creation is clumsy and prevent further refactorings related to
  copies handling.

Instead, we delegate this job to selectfile() which has all the relevant
information, and remove the hunk createfile() and rmfile() methods.
2011-05-27 21:50:09 +02:00
Adrian Buehlmann
63c4bf2469 rebase: add option --tool/-t for 'pull --rebase'
This makes 'pull --rebase' consistent with the merge command, which already
provides that option to control the merges
2011-05-27 10:03:29 +02:00
Martin Geisler
2edabc4530 subrepo: refactor writestate for clarity 2011-05-27 11:01:44 +02:00
Matt Mackall
5f2364be24 cmdutil: make private copies of option lists to avoid sharing monkeypatches 2011-05-26 17:15:35 -05:00
Idan Kamara
a7eca9ebe7 record: fix options placeholder 2011-05-26 19:00:47 +03:00
Paul Molodowitch
dfc345d9b5 subrepo: bare git repos considered dirty
Currently, if there is a bare git subrepo, but it is at the "right"
revision, calling dirty() will error because diff-index does not work
on bare repos. This patch makes it so bare subrepos are always
considered dirty.
2011-05-25 08:38:58 -07:00
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
Matt Mackall
b7ce21cbd6 httprepo: send URL redirection notices to stderr (issue2828) 2011-05-24 17:16:31 -05: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
Sune Foldager
14d5e718b5 tests: update monotone version requirement 2011-05-26 11:11:34 +02:00
Patrick Mezard
285c5cb966 test-git-import: test patching existing copy targets 2011-05-25 10:06:17 +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
Idan Kamara
67e075c860 record: alias qrecord to qnew -i/--interactive 2011-05-24 19:17:22 +03:00
Idan Kamara
dcebc5aaa6 record: add qrefresh -i/--interactive
interactively select changes to refresh
2011-05-24 19:17:19 +03:00
Idan Kamara
d4250f0ae0 record: add an option to backup all wc modifications
Also, don't create a backup dir if we have no files to backup.

This is essential for qrefresh --interactive. Since we can't
select individual files to qrefresh without eliminating already
present changes, we have to backup all changes in the working
copy to avoid refreshing unaccepted hunks.

(thanks to Patrick for the idea)
2011-05-24 19:17:04 +03:00
Idan Kamara
91b788592f record: check patch name is valid before prompting in qrecord 2011-05-24 19:17:02 +03:00
Idan Kamara
9f1caed9d1 mq: use checkpatchname
This also fixes a bug where qrename would allow
renaming a patch to a reserved name.
2011-05-24 19:16:51 +03:00
Idan Kamara
d59ad12260 mq: wrap patch file name checks in a function 2011-05-24 19:16:51 +03: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
3d12bdbaa8 graphlog: remove unused arg from _wrapcmd 2011-05-23 23:22:47 +03: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
Wagner Bruna
235cb8f6d8 i18n-pt_BR: synchronized with 84432a296ca0 2011-05-19 16:25:26 -03: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
3eec57aed2 subrepo: respect non-default path for incoming/outgoing
Push and pull set repo._subtoppath before pushing or pulling subrepos.
The incoming and outgoing commands needed to do the same.
2011-05-18 15:13:26 +02:00
Martin Geisler
9ea41d9e6c revset: the name is optional for the tag predicate 2011-05-18 09:31:19 +02:00
Martin Geisler
c9db075708 revset: note case-sensitive match in grep 2011-05-18 09:28:11 +02:00
Martin Geisler
009dc5d112 revset: note case-insensitive matches in keyword and user 2011-05-18 09:20:52 +02:00
Martin Geisler
e7ee99da82 revset: expand help for contains predicate 2011-05-18 09:15:18 +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
Peter Arrenbrecht
633f54007e tests: add tests for discovery/pull without cgsubset 2011-05-23 20:32:29 +02:00
Peter Arrenbrecht
15e07c068a tests: add tests for partial pulls with treediscovery 2011-05-23 20:31:39 +02:00
Peter Arrenbrecht
65319d53f0 tests: support multiple caps in notcapable 2011-05-23 20:31:04 +02:00
Idan Kamara
1e15ba1cc3 record: use cmdutil.command decorator 2011-05-22 16:10:03 +03:00
Idan Kamara
9966d26707 record: suggest the right command when running non interactively 2011-05-22 16:10:02 +03:00