Mercurial > hgsubversion
annotate tests/test_single_dir_clone.py @ 933:a9f315eae67c
push: use native rebase instead of our rebase wrapper
Our rebase wrapper doesn't quite do the right thing with repect to a
just-pushed revision. In particular, it will try to rebase the
just-pushed revision on top of the version of that revision we just
pulled down from svn. This will sometimes result in a local revision
with an identical commit message as the revision from svn, but no file
changes.
This changes the rebase portion of the push command to instead use the
native rebase with a revset that excludes the revision we just pushed
to svn from the set to be rebased. It also moves to a single strip
operation that removes all of the revisions based on a pre-push or
partially pushed revision. This moves to a separate rebase and strip
operation since we now need to strip revisions we are not rebasing.
author | David Schleimer <dschleimer@fb.com> |
---|---|
date | Mon, 24 Sep 2012 10:18:28 -0700 |
parents | c6388ed0ec0a |
children | d741f536f23a |
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:
577
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:
577
diff
changeset
|
2 |
531
cf4fe45bf8fd
Change all instantiations of IOError to set both errno and strerror.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
502
diff
changeset
|
3 import errno |
499
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
4 import shutil |
577
930bb6df19a0
tests: make sure single dir clone tests get run by non-nose users
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
531
diff
changeset
|
5 import unittest |
499
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
6 |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
7 from mercurial import commands |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
8 from mercurial import context |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
9 from mercurial import hg |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
10 from mercurial import node |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
11 from mercurial import ui |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
12 |
499
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
13 class TestSingleDir(test_util.TestBase): |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
14 def test_clone_single_dir_simple(self): |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
15 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
16 stupid=False, |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
17 layout='single', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
18 subdir='') |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
19 self.assertEqual(repo.branchtags().keys(), ['default']) |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
20 self.assertEqual(repo['tip'].manifest().keys(), |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
21 ['trunk/beta', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
22 'tags/copied_tag/alpha', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
23 'trunk/alpha', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
24 'tags/copied_tag/beta', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
25 'branches/branch_from_tag/alpha', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
26 'tags/tag_r3/alpha', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
27 'tags/tag_r3/beta', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
28 'branches/branch_from_tag/beta']) |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
29 |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
30 def test_auto_detect_single(self): |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
31 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
32 stupid=False, |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
33 layout='auto') |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
34 self.assertEqual(repo.branchtags().keys(), ['default', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
35 'branch_from_tag']) |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
36 oldmanifest = test_util.filtermanifest(repo['default'].manifest().keys()) |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
37 # remove standard layout |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
38 shutil.rmtree(self.wc_path) |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
39 # try again with subdir to get single dir clone |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
40 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
41 stupid=False, |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
42 layout='auto', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
43 subdir='trunk') |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
44 self.assertEqual(repo.branchtags().keys(), ['default', ]) |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
45 self.assertEqual(repo['default'].manifest().keys(), oldmanifest) |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
46 |
888
c6388ed0ec0a
svnmeta: only remove directory components in normalize()
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
871
diff
changeset
|
47 def test_clone_subdir_is_file_prefix(self, stupid=False): |
c6388ed0ec0a
svnmeta: only remove directory components in normalize()
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
871
diff
changeset
|
48 FIXTURE = 'subdir_is_file_prefix.svndump' |
c6388ed0ec0a
svnmeta: only remove directory components in normalize()
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
871
diff
changeset
|
49 repo = self._load_fixture_and_fetch(FIXTURE, |
c6388ed0ec0a
svnmeta: only remove directory components in normalize()
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
871
diff
changeset
|
50 stupid=stupid, |
c6388ed0ec0a
svnmeta: only remove directory components in normalize()
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
871
diff
changeset
|
51 layout='single', |
c6388ed0ec0a
svnmeta: only remove directory components in normalize()
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
871
diff
changeset
|
52 subdir=test_util.subdir[FIXTURE]) |
c6388ed0ec0a
svnmeta: only remove directory components in normalize()
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
871
diff
changeset
|
53 self.assertEqual(repo.branchtags().keys(), ['default']) |
c6388ed0ec0a
svnmeta: only remove directory components in normalize()
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
871
diff
changeset
|
54 self.assertEqual(repo['tip'].manifest().keys(), ['flaf.txt']) |
c6388ed0ec0a
svnmeta: only remove directory components in normalize()
Dan Villiom Podlaski Christiansen <dan@cabo.dk>
parents:
871
diff
changeset
|
55 |
499
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
56 def test_externals_single(self): |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
57 repo = self._load_fixture_and_fetch('externals.svndump', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
58 stupid=False, |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
59 layout='single') |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
60 for rev in repo: |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
61 assert '.hgsvnexternals' not in repo[rev].manifest() |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
62 return # TODO enable test when externals in single are fixed |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
63 expect = """[.] |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
64 -r2 ^/externals/project2@2 deps/project2 |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
65 [subdir] |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
66 ^/externals/project1 deps/project1 |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
67 [subdir2] |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
68 ^/externals/project1 deps/project1 |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
69 """ |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
70 test = 2 |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
71 self.assertEqual(self.repo[test]['.hgsvnexternals'].data(), expect) |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
72 |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
73 def test_externals_single_whole_repo(self): |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
74 # This is the test which demonstrates the brokenness of externals |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
75 return # TODO enable test when externals in single are fixed |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
76 repo = self._load_fixture_and_fetch('externals.svndump', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
77 stupid=False, |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
78 layout='single', |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
79 subdir='') |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
80 for rev in repo: |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
81 rc = repo[rev] |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
82 if '.hgsvnexternals' in rc: |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
83 extdata = rc['.hgsvnexternals'].data() |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
84 assert '[.]' not in extdata |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
85 print extdata |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
86 expect = '' # Not honestly sure what this should be... |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
87 test = 4 |
1fd3cfa47c5e
Support for single-directory clones.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
88 self.assertEqual(self.repo[test]['.hgsvnexternals'].data(), expect) |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
89 |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
90 def test_push_single_dir(self): |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
91 # Tests simple pushing from default branch to a single dir repo |
869
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
92 repo, repo_path = self.load_and_fetch('branch_from_tag.svndump', |
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
93 stupid=False, |
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
94 layout='single', |
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
95 subdir='') |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
96 def file_callback(repo, memctx, path): |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
97 if path == 'adding_file': |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
98 return context.memfilectx(path=path, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
99 data='foo', |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
100 islink=False, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
101 isexec=False, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
102 copied=False) |
793
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
103 elif path == 'adding_binary': |
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
104 return context.memfilectx(path=path, |
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
105 data='\0binary', |
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
106 islink=False, |
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
107 isexec=False, |
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
108 copied=False) |
531
cf4fe45bf8fd
Change all instantiations of IOError to set both errno and strerror.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
502
diff
changeset
|
109 raise IOError(errno.EINVAL, 'Invalid operation: ' + path) |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
110 ctx = context.memctx(repo, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
111 (repo['tip'].node(), node.nullid), |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
112 'automated test', |
793
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
113 ['adding_file', 'adding_binary'], |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
114 file_callback, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
115 'an_author', |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
116 '2009-10-19 18:49:30 -0500', |
832
e9af7eba88db
globally: clean up whitespace around operators and commas to conform with PEP8
Yonggang Luo <luoyonggang@gmail.com>
parents:
813
diff
changeset
|
117 {'branch': 'default', }) |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
118 repo.commitctx(ctx) |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
119 hg.update(repo, repo['tip'].node()) |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
120 self.pushrevisions() |
869
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
121 self.assertTrue('adding_file' in test_util.svnls(repo_path, '')) |
793
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
122 self.assertEqual('application/octet-stream', |
871
51fd75ae62b9
test_util: pass repo_path to svnpropget(), turn into a function
Patrick Mezard <patrick@mezard.eu>
parents:
869
diff
changeset
|
123 test_util.svnpropget(repo_path, 'adding_binary', |
51fd75ae62b9
test_util: pass repo_path to svnpropget(), turn into a function
Patrick Mezard <patrick@mezard.eu>
parents:
869
diff
changeset
|
124 'svn:mime-type')) |
793
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
125 # Now add another commit and test mime-type being reset |
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
126 changes = [('adding_binary', 'adding_binary', 'no longer binary')] |
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
127 self.commitchanges(changes) |
e698be84c22d
pushmod: fix binary files svn:mime-type (issue255)
Patrick Mezard <pmezard@gmail.com>
parents:
712
diff
changeset
|
128 self.pushrevisions() |
871
51fd75ae62b9
test_util: pass repo_path to svnpropget(), turn into a function
Patrick Mezard <patrick@mezard.eu>
parents:
869
diff
changeset
|
129 self.assertEqual('', test_util.svnpropget(repo_path, 'adding_binary', |
51fd75ae62b9
test_util: pass repo_path to svnpropget(), turn into a function
Patrick Mezard <patrick@mezard.eu>
parents:
869
diff
changeset
|
130 'svn:mime-type')) |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
131 |
502
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
132 def test_push_single_dir_at_subdir(self): |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
133 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
134 stupid=False, |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
135 layout='single', |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
136 subdir='trunk') |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
137 def filectxfn(repo, memctx, path): |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
138 return context.memfilectx(path=path, |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
139 data='contents of %s' % path, |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
140 islink=False, |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
141 isexec=False, |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
142 copied=False) |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
143 ctx = context.memctx(repo, |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
144 (repo['tip'].node(), node.nullid), |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
145 'automated test', |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
146 ['bogus'], |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
147 filectxfn, |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
148 'an_author', |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
149 '2009-10-19 18:49:30 -0500', |
832
e9af7eba88db
globally: clean up whitespace around operators and commas to conform with PEP8
Yonggang Luo <luoyonggang@gmail.com>
parents:
813
diff
changeset
|
150 {'branch': 'localhacking', }) |
502
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
151 n = repo.commitctx(ctx) |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
152 self.assertEqual(self.repo['tip']['bogus'].data(), |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
153 'contents of bogus') |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
154 before = repo['tip'].hex() |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
155 hg.update(repo, self.repo['tip'].hex()) |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
156 self.pushrevisions() |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
157 self.assertNotEqual(before, self.repo['tip'].hex()) |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
158 self.assertEqual(self.repo['tip']['bogus'].data(), |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
159 'contents of bogus') |
89eda60c90b3
single: add another test for single-dir push
Augie Fackler <durin42@gmail.com>
parents:
500
diff
changeset
|
160 |
691
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
161 def test_push_single_dir_one_incoming_and_two_outgoing(self): |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
162 # Tests simple pushing from default branch to a single dir repo |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
163 # Pushes two outgoing over one incoming svn rev |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
164 # (used to cause an "unknown revision") |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
165 # This can happen if someone committed to svn since our last pull (race). |
868
cc1c870f1758
test_util: pass repo_path to _add_svn_rev() explicitely
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
166 repo, repo_path = self.load_and_fetch('branch_from_tag.svndump', |
cc1c870f1758
test_util: pass repo_path to _add_svn_rev() explicitely
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
167 stupid=False, |
cc1c870f1758
test_util: pass repo_path to _add_svn_rev() explicitely
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
168 layout='single', |
cc1c870f1758
test_util: pass repo_path to _add_svn_rev() explicitely
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
169 subdir='trunk') |
cc1c870f1758
test_util: pass repo_path to _add_svn_rev() explicitely
Patrick Mezard <patrick@mezard.eu>
parents:
866
diff
changeset
|
170 self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed'}) |
691
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
171 def file_callback(repo, memctx, path): |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
172 return context.memfilectx(path=path, |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
173 data='data of %s' % path, |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
174 islink=False, |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
175 isexec=False, |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
176 copied=False) |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
177 for fn in ['one', 'two']: |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
178 ctx = context.memctx(repo, |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
179 (repo['tip'].node(), node.nullid), |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
180 'automated test', |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
181 [fn], |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
182 file_callback, |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
183 'an_author', |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
184 '2009-10-19 18:49:30 -0500', |
832
e9af7eba88db
globally: clean up whitespace around operators and commas to conform with PEP8
Yonggang Luo <luoyonggang@gmail.com>
parents:
813
diff
changeset
|
185 {'branch': 'default', }) |
691
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
186 repo.commitctx(ctx) |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
187 hg.update(repo, repo['tip'].node()) |
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
188 self.pushrevisions(expected_extra_back=1) |
869
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
189 self.assertTrue('trunk/one' in test_util.svnls(repo_path, '')) |
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
190 self.assertTrue('trunk/two' in test_util.svnls(repo_path, '')) |
691
a45365f1492a
push: fix case where we get >1 revs back after svn commit
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents:
643
diff
changeset
|
191 |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
192 def test_push_single_dir_branch(self): |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
193 # Tests local branches pushing to a single dir repo. Creates a fork at |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
194 # tip. The default branch adds a file called default, while branch foo |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
195 # adds a file called foo, then tries to push the foo branch and default |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
196 # branch in that order. |
869
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
197 repo, repo_path = self.load_and_fetch('branch_from_tag.svndump', |
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
198 stupid=False, |
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
199 layout='single', |
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
200 subdir='') |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
201 def file_callback(data): |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
202 def cb(repo, memctx, path): |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
203 if path == data: |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
204 return context.memfilectx(path=path, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
205 data=data, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
206 islink=False, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
207 isexec=False, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
208 copied=False) |
531
cf4fe45bf8fd
Change all instantiations of IOError to set both errno and strerror.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
502
diff
changeset
|
209 raise IOError(errno.EINVAL, 'Invalid operation: ' + path) |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
210 return cb |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
211 |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
212 def commit_to_branch(name, parent): |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
213 repo.commitctx(context.memctx(repo, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
214 (parent, node.nullid), |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
215 'automated test (%s)' % name, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
216 [name], |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
217 file_callback(name), |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
218 'an_author', |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
219 '2009-10-19 18:49:30 -0500', |
832
e9af7eba88db
globally: clean up whitespace around operators and commas to conform with PEP8
Yonggang Luo <luoyonggang@gmail.com>
parents:
813
diff
changeset
|
220 {'branch': name, })) |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
221 |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
222 parent = repo['tip'].node() |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
223 commit_to_branch('default', parent) |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
224 commit_to_branch('foo', parent) |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
225 hg.update(repo, repo['foo'].node()) |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
226 self.pushrevisions() |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
227 repo = self.repo # repo is outdated after the rebase happens, refresh |
869
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
228 self.assertTrue('foo' in test_util.svnls(repo_path, '')) |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
229 self.assertEqual(repo.branchtags().keys(), ['default']) |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
230 # Have to cross to another branch head, so hg.update doesn't work |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
231 commands.update(ui.ui(), |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
232 self.repo, |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
233 self.repo.branchheads('default')[1], |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
234 clean=True) |
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
235 self.pushrevisions() |
869
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
236 self.assertTrue('default' in test_util.svnls(repo_path, '')) |
500
5ddc212dbc56
push: fix for single directory repository layouts
Daniel Tang <dytang@cs.purdue.edu>
parents:
499
diff
changeset
|
237 self.assertEquals(len(self.repo.branchheads('default')), 1) |
577
930bb6df19a0
tests: make sure single dir clone tests get run by non-nose users
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
531
diff
changeset
|
238 |
712
1041fb1bec8c
tests & help: fix compatibility with Mercurial 1.4 and earlier.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
701
diff
changeset
|
239 @test_util.requiresoption('branch') |
701
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
240 def test_push_single_dir_renamed_branch(self, stupid=False): |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
241 # Tests pulling and pushing with a renamed branch |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
242 # Based on test_push_single_dir |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
833
diff
changeset
|
243 repo_path = self.load_svndump('branch_from_tag.svndump') |
701
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
244 cmd = ['clone', '--layout=single', '--branch=flaf'] |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
245 if stupid: |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
246 cmd.append('--stupid') |
866
20e73b5ab6f7
test_util: merge load_svndump_fixture() into TestBase
Patrick Mezard <patrick@mezard.eu>
parents:
833
diff
changeset
|
247 cmd += [test_util.fileurl(repo_path), self.wc_path] |
813
f07bfd66db13
test_util: handle dispatch.dispatch() taking a request
Patrick Mezard <pmezard@gmail.com>
parents:
793
diff
changeset
|
248 test_util.dispatch(cmd) |
701
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
249 |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
250 def file_callback(repo, memctx, path): |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
251 if path == 'adding_file': |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
252 return context.memfilectx(path=path, |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
253 data='foo', |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
254 islink=False, |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
255 isexec=False, |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
256 copied=False) |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
257 raise IOError(errno.EINVAL, 'Invalid operation: ' + path) |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
258 ctx = context.memctx(self.repo, |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
259 (self.repo['tip'].node(), node.nullid), |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
260 'automated test', |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
261 ['adding_file'], |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
262 file_callback, |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
263 'an_author', |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
264 '2009-10-19 18:49:30 -0500', |
832
e9af7eba88db
globally: clean up whitespace around operators and commas to conform with PEP8
Yonggang Luo <luoyonggang@gmail.com>
parents:
813
diff
changeset
|
265 {'branch': 'default', }) |
701
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
266 self.repo.commitctx(ctx) |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
267 hg.update(self.repo, self.repo['tip'].node()) |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
268 self.pushrevisions() |
869
db3a651494f9
test_util: pass repo_path to svnls(), turn it into a function
Patrick Mezard <patrick@mezard.eu>
parents:
868
diff
changeset
|
269 self.assertTrue('adding_file' in test_util.svnls(repo_path, '')) |
701
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
270 |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
271 self.assertEquals(set(['flaf']), |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
272 set(self.repo[i].branch() for i in self.repo)) |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
273 |
712
1041fb1bec8c
tests & help: fix compatibility with Mercurial 1.4 and earlier.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
701
diff
changeset
|
274 @test_util.requiresoption('branch') |
701
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
275 def test_push_single_dir_renamed_branch_stupid(self): |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
276 self.test_push_single_dir_renamed_branch(True) |
3b8088de027d
clone: replace the --singlebranch with overloading for --branch
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
691
diff
changeset
|
277 |
577
930bb6df19a0
tests: make sure single dir clone tests get run by non-nose users
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
531
diff
changeset
|
278 def suite(): |
833
312b37bc5e20
tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents:
832
diff
changeset
|
279 all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestSingleDir)] |
312b37bc5e20
tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents:
832
diff
changeset
|
280 return unittest.TestSuite(all_tests) |