Commit Graph

977 Commits

Author SHA1 Message Date
Patrick Mezard
782852b3d1 updatemeta: add missing EOL to status messages 2012-12-01 18:46:24 +01:00
Anton Agafonov
a55ee7944c Fixes bug #358. Display correct error message if a svn pre-commit hook blocks the push 2012-11-26 11:38:34 -08:00
Augie Fackler
17069bf4ee cleanup: avoid \' in strings where easy 2012-12-04 17:26:59 -06:00
Mitsuhiro Koga
0537ce1fac wrappers: Return the same value as the original incoming command 2012-11-22 12:56:49 +09:00
Mitsuhiro Koga
63d67bf1e2 wrappers: Implement --newest-first option in incoming command 2012-11-22 12:54:34 +09:00
Mitsuhiro Koga
9a542b8c61 Layout option can be accepted only auto, single, or standard. 2012-11-22 12:45:43 +09:00
Augie Fackler
82f3cacb61 Merge with stable. 2012-11-11 15:31:52 -06:00
Dan Villiom Podlaski Christiansen
c5dea72803 pull: save the last pulled revision *after* converting revisions
Otherwise, a KeyboardInterrupt may lead to an unpulled revision being
incorrectly saved as pulled in the lastpulled file. This will lead to
the interrupted revision being incorrectly skipped at the next pull,
leading to an incorrect conversion -- one might even say corrupt.

Due to it's nature of requiring a manual interrupt, this bug is
difficult to test.
2012-11-11 15:31:19 +01:00
Dan Villiom Podlaski Christiansen
cf53222530 pull: use a single if-statement for the two ways to skip revisions 2012-11-11 15:31:19 +01:00
Dan Villiom Podlaski Christiansen
8f29ffec6e svn verify: print out diffs of bad files in a verbose mode 2012-11-11 15:31:19 +01:00
Dan Villiom Podlaski Christiansen
296811c938 subvertpy wrapper: rename AbstractEditor to BaseEditor
We actually instantiate it, so the name is horribly wrong. While at
it, I gave the two subclasses __slots__ entries as well.
2012-11-11 15:31:19 +01:00
Dan Villiom Podlaski Christiansen
8ac0d616ac editor: ensure that we propagate full stacktraces in a few places 2012-11-11 15:31:19 +01:00
Dan Villiom Podlaski Christiansen
f6057dd24b maps: only show 'reading ...' as debug output
I find it a bit too chatty for verbose output...
2012-11-11 15:30:49 +01:00
Dan Villiom Podlaski Christiansen
ec66e00a4f understand 'tip' as meaning Subversion 'HEAD' 2012-11-04 11:34:43 +01:00
Dan Villiom Podlaski Christiansen
d22af9a2df consolidate revision parsing
Accept HEAD for --rev and --skiprevs as well as --startrev, and make
the error message more closely mirror the regular Mercurial error
message.
2012-11-04 11:34:16 +01:00
Mitsuhiro Koga
93b9795d2b svn_swig_wrapper: Ensure subversion config files
We will create a subversion config file if it does not exist.
Currently, svn_config_ensure() exists only swig.
2012-10-29 20:16:19 +09:00
Mitsuhiro Koga
cfd0eba053 svnrepo: Support --insecure option the same as the mercurial
To bypass verification of ssl certificate on one of the following:
- Specify the --insecure option
- Set the fingerprint to config hostfingerprints
2012-10-29 20:14:47 +09:00
Mitsuhiro Koga
b28225df89 svnwrap: Implement handling of ssl_client_cert_pw_prompt_provider 2012-10-23 03:50:00 +09:00
Mitsuhiro Koga
46eebbab08 svnwrap: Implement handling of ssl_client_cert_prompt_provider 2012-10-23 19:33:15 +09:00
Mitsuhiro Koga
2e72c9c185 svnwrap: Improved handling of username_prompt_provider 2012-10-23 20:12:10 +09:00
Mitsuhiro Koga
5952188779 svnwrap: Improved handling of simple_prompt_provider 2012-10-23 20:12:32 +09:00
Mitsuhiro Koga
c65b7d4cec svnwrap: Refactor the svn_auth_ssl_server_trust_prompt to add other handler
- Since there are five handler, change to SubversionPrompt class from svn_auth_ssl_server_trust_prompt().
- Moved out of the handler to check the callback function is non-None.
2012-10-24 02:19:15 +09:00
Mitsuhiro Koga
a54ae1f482 svnwrap: Implement handling of get_ssl_server_trust_prompt_provider
If the server certificate is untrusted when connected to a subversion repository
using the connection SSL, respond with a message similar to svn client.
Here, we can choose either a permanent accept, temporary accept, rejection.
2012-10-10 00:28:38 +09:00
Patrick Mezard
321f15f9f7 editor: do not record invalid path deletion 2012-10-15 22:24:29 +02:00
Patrick Mezard
113b14171f editor: process missing files with regular files
Missing files were stored directly in RevisionMeta and resolved after
the revision was replayed. It means the missing files set was no pruned
by delete_entry() actions or by the filemap, and some of them were
fetched for no reason.

Say you convert:

  A branch/foo/bar (from trunk/foo/bar:123)

with a filemap excluding "foo/bar". Since the directory was excluded in
trunk the files cannot be found and were marked as missing even though
they were discarded afterwards.
2012-10-20 22:22:02 +02:00
Patrick Mezard
1c33a3ec2d tests: add tests where files are moved from root to trunk
It triggers a special case of missing path with a different root layout.
2012-10-20 22:24:32 +02:00
Patrick Mezard
e7a0b2ca1b editor: ignore added or copied files excluded by a filemap
Files brought by a copied add_directory() were processed despite being
excluded by the filemap. This was also the case with added files. The
conversion was still correct because they were eventually filtered out
in the replay.convert_rev() but processing them in itself may be
problematic. Filemaps are often use to exclude large binary files and
before this change, some of them could be marked as missing and be
fetched before being discarded.

A test configuration entry named hgsubversion.failoninvalidreplayfile
was added to help testing this case. It should become the default
behaviour in the future.
2012-10-14 15:51:12 +02:00
Patrick Mezard
2ada29a7d7 svnmeta: fix list not being joined in split_branch_path() 2012-10-14 15:29:12 +02:00
Patrick Mezard
976e15a2ea editor: tidy up directory batons handling
- Check they are opened in DFS order
- Do not make a special case for the root baton
2012-10-14 14:26:53 +02:00
Patrick Mezard
398c100ed0 editor: improve debug information when fetching files in replay 2012-10-14 12:35:13 +01:00
Patrick Mezard
9cd312417e maps: fix filemap loading --verbose message
The m.stri('e') was removing the leading 'e' or 'exclude'.
2012-10-14 13:21:03 +02:00
Patrick Mezard
2413c9c6cf replay: remove useless warning about invalid externals
The warning is wrong when a filemap is used, and if we expect the
externals to be filtered already, let's make this abort instead of
warning.
2012-10-07 21:06:25 +02:00
Patrick Mezard
f3818413b3 test_fetch_mappings: reduce copy/paste 2012-10-07 20:34:04 +02:00
Patrick Mezard
fab51edb18 test_rebuildmeta: fix src/dest typo 2012-10-07 20:15:43 +02:00
Patrick Mezard
89373467f1 stupid: do not close branch upon branch-wide revert
Reverting a branch with a remove followed by a copy results in a branch
replacement. By default, branch replacements are handled by closing the
replaced branch and committing the new branch on top of it. But we do
not really want that when reverting a branch, we only want a linear
history with a changeset capturing the revert.
2012-10-16 21:17:55 +02:00
Patrick Mezard
864fd52f76 editor: add a small changectx cache
Reverts including a lot of files create many actions like:

  R bar (from trunk/bar:4343)

For each of these files, an open_file() call is made and the parent
mercurial revision is loaded to detect copies in issamefile(). This
results in a big slowdown, easily reduced by caching the changectx.
2012-10-06 09:42:07 +02:00
Patrick Mezard
0e46c925de editor: relax copyfrom dir checks to avoid extra missing entries
When renaming a branch you get something like:

  D /branch/bar
  A /branch/foo (from /branch/foo:42)

Unfortunately, the branch layout for the revision being converted is
computed before starting to convert it. It means the copyfrom path
supplied in the add_directory() for /branch/foo will be be considered
invalid, be added to missing and fetched the slow way despite being in
the repository history. Avoid that by checking the path looks like a
branch path and matching it with the filemap. It will be resolved
afterwards anyway.
2012-10-06 10:10:35 +02:00
Patrick Mezard
1b44e9bd2f editor: add addmissing() and test config to make it fail
Missing files should be the exception not the norm. Right now, a lot of
these are caused by incorrect handling of branch updates. The
hgsubversion.failonmissing configuration entry will help chase them.
2012-10-06 10:09:09 +02:00
Patrick Mezard
36f644e1b9 editor: use SimpleStringIO in apply_text()
The design is a little ugly as the data stored in _openfiles will be a
string or a SimpleStringIO depending on the file having been edited or
not but this is a simple way to avoid allocating large blocks of data.
This is also a bet the output stream passed to apply_text() is only
being written and never seeked or read.
2012-09-26 22:18:31 +02:00
Patrick Mezard
9f5e4b2f1d editor: do not reread all data upon branching
Branch creation is a special case of add_directory(). Until now, it was
handled by enumerating branch parent files and creating svncopy records
which were later converted into open files or pushed into the
RevisionData. By default, there is no reason to record anything, the
files are the same than in the parent changeset. The tricky part is to
correctly check the source is the parent revision. This change massively
speeds up regular branching operations.
2012-10-16 08:47:01 +02:00
Patrick Mezard
275fc0b547 push: reset encoding before the final update
Before 6ba25d2444f3, all the rebase sequence including the update
was executed with the encoding reset to the native one. After the
change, the final update was left out and ran with UTF-8, which
fails for some badly shaped repository. Reset the correct encoding
context.
2012-10-12 21:30:24 +02:00
Patrick Mezard
247687cce1 editor: add a pop() method to RevisionMeta to reduce resource usage
The commit pass only has to read files once, removing the related data
after the read helps not keeping large temporary files around after they
have been stored
2012-09-26 21:01:17 +02:00
Patrick Mezard
f1be3abd56 pull: add hgsubversion.filestoresize to control memory consumption
The configuration entry defines the size of the replay or stupid edited
file store, that is the maximum amount of edited files data in megabytes
which can be kept in memory before falling back to storing it in a
temporary directory. Default to 200 (megabytes), use -1 to disable.
2012-09-28 21:43:50 +02:00
Patrick Mezard
59e15dd4a6 editor: move RevisionData on the filesystem over a given threshold
The implementation is similar to the one in mercurial.patch except the
mode and copy information are currently kept outside. It minimizes
changes to RevisionData and helps with files which properties are
modified but not their contents, which filestore was not designed to
handle. Besides, CopiedFile pushed from the editor may later be handled
separately to resolve them at commit time, in which case we would store
the metadata outside of the file stores.
2012-10-06 09:59:55 +02:00
Patrick Mezard
0eeccf97f4 editor: do not touch RevisionData copies from the editor
Copy source can be passed when adding the file to the revision data.
2012-09-25 21:34:16 +02:00
Patrick Mezard
3177d896a1 editor: handle deleted files in editor
Handling deleted files in the editor let us decouple the temporary state
from the final one stored in RevisionData.
2012-10-03 21:04:37 +02:00
Patrick Mezard
5629a00f63 editor: resolve files copied by directory copy on-demand
Before this change, the data of files brought by directory copies was
resolved immediately and stored for the duration of the run. Now, only
references are stored and are resolved either when opening the files or
when closing the editor. It means RevisionData file data is only set
once per file and only when the file has been handled.

The next step is to turn RevisionData into a data store backed by the
filesystem.
2012-09-24 23:44:23 +02:00
Patrick Mezard
ceaf6f2206 editor: add close_file(), enforce file batons semantics
Supporting close_file() is a big step toward reducing memory consumption
as now know which files are still to be edited and which are done
already.
2012-09-24 23:12:01 +02:00
Patrick Mezard
0d98dd5413 editor: start separating svn copies from open files
The separation is not complete as we still have to update the
RevisionData deleted set when registering svn copies. This will be
cleaned up once open files are themselves separated from RevisionData.

Copied symlinks are also being prefixed with 'link '.
2012-10-03 21:27:02 +02:00
Patrick Mezard
77811f46f4 editor: implement file batons
The concept of current.file is incorrect, svn_delta.h documents open
file lifetime as:

 * 5. When the producer calls @c open_file or @c add_file, either:
 *
 *    (a) The producer must follow with any changes to the file
 *    (@c change_file_prop and/or @c apply_textdelta, as applicable),
 *    followed by a @c close_file call, before issuing any other file
 *    or directory calls, or
 *
 *    (b) The producer must follow with a @c change_file_prop call if
 *    it is applicable, before issuing any other file or directory
 *    calls; later, after all directory batons including the root
 *    have been closed, the producer must issue @c apply_textdelta
 *    and @c close_file calls.

So, an open file can be kept open until after the root directory is
closed and have deltas applied afterwards. In the meantime, other files
may have been opened and patched, overwriting the current.file variable.

This patch fixes it by introducing file batons bound to file paths, and
using them to deduce the correct target in apply_textdelta(). In theory,
open files could be put in a staging area until they are closed and
moved in the RevisionData. But the current code registers files copied
during a directory copy as open files and these will not receive a
close_file() event. This separation will be enforced later.
2012-09-23 19:52:48 +02:00