Commit Graph

67 Commits

Author SHA1 Message Date
Durham Goode
6099956ed8 tests: use hostname instead of localhost
The test_push_command test was failing on our machines because the machines are
ipv6 but expose ipv4 on the 127.0.0.1 loopback interface. This caused the
svnserve process to listen via ipv4, but the connecting process would attempt to
connect on ipv6 and fail. Using the hostname causes it to listen using the
primary network interface, which matches the interface that is used when the
connecting client resolves the hostname. So the test now passes.
2016-06-07 14:35:30 -07:00
Siddharth Agarwal
bbb67e8a1f tests: always compare manifest keys in sorted order
Not comparing sorted lists was probably always a mistake, but it became an
actual failure when upstream Mercurial changed to using lazymanifest, which
always returns keys in sorted order.
2015-03-27 16:44:05 -07:00
Siddharth Agarwal
a1b6b90c4f test_push_command: use compat hack for filectxfn for deleted files 2014-09-16 16:03:31 -07:00
David Schleimer
02682b7f4c push: update to branch tip instead of tip
We previously updated to the repository tip after pushing a revision,
presumably on the assumption that tip would be the last revision we
just pushed.  This assumption is flawed for high traffic repositories.
In particular, you previsouly would sometimes end up on a completley
unrelated commit if someone else commits to a different branch in
between the time we push a revision and pull it back from the server.

This changes to instead update to the branch tip of the branch we were
on at the beginning of the push.  This should be either the revision
we just pushed or a linear descendent of the revision we just pushed,
with a fair degree of reliability.
2014-08-30 09:23:31 -07:00
Augie Fackler
0a239b82dd Merge with stable. 2014-08-12 11:08:41 -04:00
David Schleimer
c2f7ff1156 pushmod: prepend "link " to base text for links
http://svn.apache.org/viewvc?view=revision&revision=1223036 exposes
what is arguably a bug in hgsubversion push code.  Specifically, when
we are receiving text from the server in an editor, we prepend a "link
" to the text of symlinks when opening a file and strip it when
closing a file.  We don't, however, prepend "link " to the base we use
when sending text changes to the server.

This was working before because prior to that revision, the first
thing subversion did was to check whether the entirety of the before
text or the entirety of the after text was less than 64 bytes.  In
that case, it just sent the entirety of the after text as a single
insert operation.  I'd expect most, but not all symlinks to fit under
the 64 byte limit, including the leading "link " text on the
subversion end.

After the change, the first thing subversion does is check for a
leading match that is more than 4 bytes long, or that is the full
length of the after text.  In this case, it sends a copy operation for
the leading match, and then goes into the if < 64 bytes remaining send
the whole thing behavior.  It also looks for trailing matches of more
than 4 bytes even in the <64 byte case, but that's not what breaks the
tests.

Incidentally, changing the destination of long symlinks was broken
even before this subversion change.  This diff includes test additions
that cover that breakage.
2014-08-07 19:30:26 -07:00
Sean Farley
b49fb3a597 test_push_command: call makememfilectx 2014-06-02 19:41:37 -05:00
Augie Fackler
0d5733fae7 test_push_command: improve commit messages inside test for diagnostics
This let me determine a little bit of a disturbing test failure:
test_push_existing_file_newly_symlink is broken against svn 1.8.8 for
me (and against svn 1.8.9 for Sean). This isn't a regression on our
part, but we need to work around this in the near future.
2014-07-16 14:52:33 -04:00
Sean Farley
6496470333 test_push_command: call makememfilectx 2014-06-02 19:41:37 -05:00
Dan Villiom Podlaski Christiansen
d5e302cab7 push: obsolete rather than rebase & strip when enabled
This requires a few changes to wrappers.push() to use obsolescence
rather than strip and to make the rebase -- which is non-destructive
with obsolete active -- to no longer keep the originals. Possible
future work involves no longer relying on rebase for non-outgoing
revisions, and simply leaving them in the troubled state.

We test this feature by adding setting obsolete_mode_tests to True in
classes that push changes.
2013-08-09 19:30:25 +02:00
Dan Villiom Podlaski Christiansen
ad44214b16 tests: count revisions explicitly
The assumption that len(repo) corresponds to the count of actual,
usable revision in the repository fails in presence of hidden
revisions. Instead, we use a dedicated method in test_util, and change
all tests to use this for obtaining repository length -- just to be
safe...
2013-08-09 11:22:50 -04:00
Dan Villiom Podlaski Christiansen
b360f4a66d tests: remove old test-loading infrastructure
(for those in the know, this is known as a suitectomy)
2013-08-07 16:00:52 +02:00
Dan Villiom Podlaski Christiansen
0ff4906cfb fixes for running under Mercurial 2.0 2013-08-05 20:27:31 +02:00
Augie Fackler
e00473c43d push: also suggest user rebase if we get SVN_ERR_FS_ALREADY_EXISTS
Subversion differentiates adding an already-added file from
transaction being out of date and edit conflicts. Fixes #400.
2013-07-16 10:09:55 -04:00
Kapil Bajaj
c6e7624a4a push: avoid failure when push is being called from a newly created subdirectory
The failure was occuring during push when a new file is added inside a new subdirectory and push is being called from this subdirectory.
This subdirectory disappears when the commit is being rebased[during push] causing the push to fail with 'no such file/directory' error.
2013-01-17 17:01:45 -08:00
Durham Goode
ee7e5eee75 push: avoid rebasing when we know there are no conflicts
When pushing multiple commits, push would do one rebase
per commit. This changes it track the files that have been
changed as part of the push and only perform a rebase if
the commit touches a file that has been changed previously.

On our repo, push used to take 25 seconds per commit. With
this change it takes closer to 10 seconds per commit (if
there are no conflicts).
2013-01-02 17:54:30 -08:00
Durham Goode
90870aa082 push: rebase one at a time before push
Previously when pushing n commits, push would rebase n,
commit 1, rebase n-1, commit 1, rebase n-2, etc. This
caused push to be very slow on large repositories. Pushing
10 commits on our repo took 75 seconds per commit, and that
grew at n^2 with the number of commits being pushed.

This changes push to rebase each commit individually. Now
pushing 10 commits on our repo takes 25 seconds per commit,
and is constant relative to the number of commits being
pushed.
2013-01-02 17:51:07 -08:00
Patrick Mezard
93ab11c5eb pushmod: keep the root svn dir when emptying the hg repo (issue359) 2012-09-09 16:12:28 +02:00
Patrick Mezard
89f7e41f13 wrappers: do not change encoding when pushing
This causes problems on platforms where the encoding is actually different,
if the manifest contains a path which no longer matches the checkout, a
following bailifchanged() actually fails.

This happens on Windows with a repository containing UTF-8 encoded filenames
checked out on a cp1252 environment.
2012-09-09 14:54:43 +02:00
Augie Fackler
60fb317a46 push test: peek inside svn's pending transaction list on abort
This helps us verify that aborting a transaction is being done
properly.
2012-05-17 08:24:54 -05:00
Patrick Mezard
2acf9274f4 test_util: remove self.repo_path, generate new paths each time
This solves a problem with startrev tests sporadically failing in ra.get_log()
with some kind of svn corruption error. Loading each svn repository in a
different place solved that, or at least prevented me from reproducing it. What
is interesting is this is the same fixture being loaded each time. Also, before
loading the fixture, we take care of removing an existing repository. Loading
with the same options twice also failed reproducing the issue. Same thing if
the first load only load the svn repository but does not convert it.

So, I have absolutely no idea what was wrong, blame python subprocess,
subversion or some kind of filesystem write ordering bug.
2012-04-19 18:29:32 +02:00
Patrick Mezard
84977d28d5 test_util: merge load_svndump_fixture() into TestBase 2012-04-19 18:29:28 +02:00
Patrick Mezard
76b3efe6d9 test_util: merge load_fixture_and_fetch() into TestBase method
The middle-term goal is to make TestBase repo_path and wc_path private, so they
can be changed for every load call. This is not required to use nosetests
multiprocess facility as the fixtures create temporary directories but it makes
things much clearer and avoid weird cases where a repository was loaded several
times at the same location in a single test (cf test_startrev). That way we
will be more confident the tests can be parallelized.

The long term goal is to make hgsubversion compatible with nosetests
--processes option.
2012-04-19 18:29:25 +02:00
Arne Babenhauserheide
5fb1df3209 tests: push_command: use svnserve.kill() in Python >=2.6 2012-04-12 15:39:17 +02:00
Yonggang Luo
effea7aa72 test_push_command: tests -> all_tests for consistency with other files 2011-10-12 15:50:47 +08:00
Yonggang Luo
bebd961e2a globally: clean up whitespace around operators and commas to conform with PEP8
Mostly autoformatted by Eclipse. A few manual corrections were
performed where Eclipse's autoformatter did something non-idiomatic.
2011-10-12 15:35:25 +08:00
Patrick Mezard
22cd559d10 Fix hg.clone() calls changed by b5892bbedb6a 2011-06-15 14:44:14 +02:00
Dan Villiom Podlaski Christiansen
2fa6c3592c maps: map a missing author to '(no author)'
"None" doesn't really make much sense, so we use what 'svn log' shows
instead. This also fixes mapping this author to something else.
2010-10-09 16:20:52 -05:00
Peter Arrenbrecht
1f827f21a6 tests: remove constant rev no from test script 2010-09-08 10:42:53 +02:00
Peter Arrenbrecht
edcee72d6c svnmeta: strip all repeated slashes from subdir 2010-07-28 14:47:44 +02:00
Dan Villiom Podlaski Christiansen
ade1537f2e tests: import test_util as the first module in all relevant tests 2010-07-14 15:39:18 +02:00
Augie Fackler
1d5fa230a4 push: return reasonable status codes to the end user 2010-06-27 21:18:47 -05:00
Augie Fackler
58dc3e11f3 tests: fix misnamed test caught while hunting unrelated bugs 2010-06-27 21:14:36 -05:00
Dirkjan Ochtman
e5b9813875 tests: silence test suite by using quiet UIs everywhere 2010-02-26 14:50:22 +01:00
Augie Fackler
5798f3a681 replay/stupid: raise the correct errno in IOError to fix hg >= e370ad539526
Basically, all the IOErrors we ever raise inside a file commit function
that is sent to commitctx should be ENOENT. This suggests a change
should be made in commitctx to not overload IOError.
2010-02-14 14:04:56 -06:00
Patrick Mezard
1afd95ae82 pushmod: make outdated parent error message more helpful 2010-02-07 15:56:25 +01:00
Dan Villiom Podlaski Christiansen
5a94472195 Change all instantiations of IOError to set both errno and strerror. 2010-01-26 17:36:13 +01:00
Augie Fackler
78ab48bb18 Merge win32 fixes 2009-08-08 08:01:24 -05:00
Risto Kankkunen
a58890b5be No os.kill() in Windows, use ctypes to call Win32 TerminateProcess() 2009-07-29 19:01:13 +03:00
Patrick Mezard
4531a85f02 wrappers: make push aborts if uncommitted changes 2009-07-18 20:44:33 -05:00
Augie Fackler
c4ba46f1f0 push: don't refuse to push if it looks like we haven't pulled all changes.
We can't rely on the most-recent change number matching our most-recent
change number because there can be changes in svn that produce no
corresponding hg changeset.
2009-05-27 21:40:58 -05:00
Dan Villiom Podlaski Christiansen
fae3070938 test_push_command: this test causes an author of None.
This may be unintended, but we should test for it nonetheless.
2009-05-22 13:42:51 +02:00
Dan Villiom Podlaski Christiansen
df55ee21ef test_push_command: improve readability a bit. 2009-05-22 13:41:21 +02:00
Dan Villiom Podlaski Christiansen
8ccdbbe1e9 Minor tweaks to wrapper documentation. 2009-05-19 11:43:49 +02:00
Augie Fackler
94a7ecbe68 Reorganize to have a more conventional module structure.
This means that hgsubversion now uses absolute imports instead of
relative ones, which makes the tests more reliable.
2009-05-13 21:39:39 -05:00
Augie Fackler
57b5041576 Use try/finally in an attempt to stop leaking svnserve processes. 2009-05-13 10:22:18 -05:00
Dan Villiom Podlaski Christiansen
25a2353e91 Switch to using url scheme wrappers instead of duplicating each command we wrap.
The 'hg svn url' command has been killed; the replacement is
'.hg/hgrc'. More stuff related to its disappearance has been stripped,
including two tests.

HgChangeReceiver now takes a UUID argument, which it uses to ensure
that remote repositories remain unchanged. This is a temporary
solution, and I'm not entirely satisfied with how it's done either.

Access to the UUID file has been isolated in a HgChangeReceiver
property.

Some more tests have been updated to use ui.pushbuffer()/popbuffer(),
and to pass through the Mercurial API.

Moved the arguments to wrappers.pull() to the UI configuration.

Also, remove HgChangeReceiver.opts in favour of a 'usebranchnames'
instance & configuration variable. The name is taken from the
ConvertExtension.
2009-05-15 19:18:43 +02:00
Augie Fackler
0ca6ba9b90 push: Add a test that demonstrates base-text detection works 2009-04-24 20:31:17 -05:00
Augie Fackler
04a99bbad0 Move wrappers for hg commands to their own module. 2009-04-10 22:38:29 -05:00
Dirkjan Ochtman
2ca3d49704 Move push into svncommands. 2009-04-08 17:53:48 +02:00