Mercurial > hgsubversion
annotate tests/test_fetch_exec.py @ 1234:d3c79072bc6a
editor: correctly import symlink copy+modify with non-empty prefix
We alwasy fail editing for symlinks, since we strip the leading 'link '
subversion includes when storing in mercurial, and then let svn
attempt to apply deltas against the stripped version. This
unsurprisingly fails, and we write the resulting empty-string to the
Filestore for the current revision, and add the symlink in question to
the missing list to handle stupidly later.
Unfortunately, this would break down because editing adds files to the
store using their absolute path whereas missing files are added
relative to our subdir. the absolut path file appears to win, which
results in us getting a symlink whose target is the empty string.
This fixes the problem by adding missing files to the fileStore using
their absolute path.
author | David Schleimer <dschleimer@fb.com> |
---|---|
date | Mon, 07 Apr 2014 18:28:35 -0700 |
parents | 449c61eeace7 |
children |
rev | line source |
---|---|
643
d2ef7220a079
tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
158
diff
changeset
|
1 import test_util |
d2ef7220a079
tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
158
diff
changeset
|
2 |
125
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 import unittest |
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 |
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 from mercurial import node |
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
6 |
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 class TestFetchExec(test_util.TestBase): |
1063
449c61eeace7
test_fetch_exec: use metaclass stupid mode tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
8 stupid_mode_tests = True |
449c61eeace7
test_fetch_exec: use metaclass stupid mode tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
9 |
125
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 def assertexec(self, ctx, files, isexec=True): |
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
11 for f in files: |
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 self.assertEqual(isexec, 'x' in ctx[f].flags()) |
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
13 |
1063
449c61eeace7
test_fetch_exec: use metaclass stupid mode tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
14 def test_exec(self): |
449c61eeace7
test_fetch_exec: use metaclass stupid mode tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
15 repo = self._load_fixture_and_fetch('executebit.svndump') |
125
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 self.assertexec(repo[0], ['text1', 'binary1', 'empty1'], True) |
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 self.assertexec(repo[0], ['text2', 'binary2', 'empty2'], False) |
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 self.assertexec(repo[1], ['text1', 'binary1', 'empty1'], False) |
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 self.assertexec(repo[1], ['text2', 'binary2', 'empty2'], True) |
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 |
1063
449c61eeace7
test_fetch_exec: use metaclass stupid mode tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
21 def test_empty_prop_val_executable(self): |
449c61eeace7
test_fetch_exec: use metaclass stupid mode tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
1044
diff
changeset
|
22 repo = self._load_fixture_and_fetch('executable_file_empty_prop.svndump') |
125
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 self.assertEqual(node.hex(repo['tip'].node()), |
154
6fa97cfbf62f
fetch: Refactor extra creation to be shared by real and diff replay.
Augie Fackler <durin42@gmail.com>
parents:
125
diff
changeset
|
24 '08e6b380bf291b361a418203a1cb9427213cd1fd') |
125
c35f59aa200e
Move and complete execute bit conversion tests into test_fetch_exec.py
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 self.assertEqual(repo['tip']['foo'].flags(), 'x') |