| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,6 +49,20 @@ Repo | |||
| 49 | 49 | * Corrected ``commits_between`` always returning None instead of the reversed | |
| 50 | 50 | list. | |
| 51 | 51 | ||
| 52 | + | ||
| 53 | + 0.1.X | ||
| 54 | + ===== | ||
| 55 | + ( Future Release ) | ||
| 56 | + General | ||
| 57 | + ------- | ||
| 58 | + * See changes in Diff class as your client code needs adjustments to work with it | ||
| 59 | + | ||
| 60 | + Diff | ||
| 61 | + ---- | ||
| 62 | + * Members a a_commit and b_commit renamed to a_blob and b_blob - they are populated | ||
| 63 | + with Blob objects if possible | ||
| 64 | + * Members a_path and b_path removed as this information is kept in the blobs | ||
| 65 | + | ||
| 52 | 66 | ||
| 53 | 67 | 0.1.5 | |
| 54 | 68 | ===== | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -152,7 +152,7 @@ def blame(cls, repo, commit, file): | |||
| 152 | 152 | m = re.search(r'^\t(.*)$', line) | |
| 153 | 153 | text, = m.groups() | |
| 154 | 154 | blames[-1][0] = c | |
| 155 | - blames[-1][1] += text | ||
| 155 | + blames[-1][1].append( text ) | ||
| 156 | 156 | info = None | |
| 157 | 157 | ||
| 158 | 158 | return blames | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,7 @@ class Git(object): | |||
| 35 | 35 | of the command to stdout. | |
| 36 | 36 | Set its value to 'full' to see details about the returned values. | |
| 37 | 37 | """ | |
| 38 | - def __init__(self, git_dir): | ||
| 38 | + def __init__(self, git_dir=None): | ||
| 39 | 39 | """ | |
| 40 | 40 | Initialize this instance with: | |
| 41 | 41 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,28 +5,44 @@ | |||
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | ||
| 7 | 7 | import re | |
| 8 | - import commit | ||
| 8 | + import blob | ||
| 9 | 9 | ||
| 10 | 10 | class Diff(object): | |
| 11 | 11 | """ | |
| 12 | 12 | A Diff contains diff information between two commits. | |
| 13 | + | ||
| 14 | + It contains two sides a and b of the diff, members are prefixed with | ||
| 15 | + "a" and "b" respectively to inidcate that. | ||
| 16 | + | ||
| 17 | + Diffs keep information about the changed blob objects, the file mode, renames, | ||
| 18 | + deletions and new files. | ||
| 19 | + | ||
| 20 | + There are a few cases where None has to be expected as member variable value: | ||
| 21 | + | ||
| 22 | + ``New File``:: | ||
| 23 | + | ||
| 24 | + a_mode is None | ||
| 25 | + a_blob is None | ||
| 26 | + | ||
| 27 | + ``Deleted File``:: | ||
| 28 | + | ||
| 29 | + b_mode is None | ||
| 30 | + b_blob is NOne | ||
| 13 | 31 | """ | |
| 14 | 32 | ||
| 15 | - def __init__(self, repo, a_path, b_path, a_commit, b_commit, a_mode, | ||
| 33 | + def __init__(self, repo, a_path, b_path, a_blob, b_blob, a_mode, | ||
| 16 | 34 | b_mode, new_file, deleted_file, rename_from, | |
| 17 | 35 | rename_to, diff): | |
| 18 | 36 | self.repo = repo | |
| 19 | - self.a_path = a_path | ||
| 20 | - self.b_path = b_path | ||
| 21 | 37 | ||
| 22 | - if not a_commit or re.search(r'^0{40}$', a_commit): | ||
| 23 | - self.a_commit = None | ||
| 38 | + if not a_blob or re.search(r'^0{40}$', a_blob): | ||
| 39 | + self.a_blob = None | ||
| 24 | 40 | else: | |
| 25 | - self.a_commit = commit.Commit(repo, id=a_commit) | ||
| 26 | - if not b_commit or re.search(r'^0{40}$', b_commit): | ||
| 27 | - self.b_commit = None | ||
| 41 | + self.a_blob = blob.Blob(repo, id=a_blob, mode=a_mode, name=a_path) | ||
| 42 | + if not b_blob or re.search(r'^0{40}$', b_blob): | ||
| 43 | + self.b_blob = None | ||
| 28 | 44 | else: | |
| 29 | - self.b_commit = commit.Commit(repo, id=b_commit) | ||
| 45 | + self.b_blob = blob.Blob(repo, id=b_blob, mode=b_mode, name=b_path) | ||
| 30 | 46 | ||
| 31 | 47 | self.a_mode = a_mode | |
| 32 | 48 | self.b_mode = b_mode | |
@@ -39,6 +55,17 @@ def __init__(self, repo, a_path, b_path, a_commit, b_commit, a_mode, | |||
| 39 | 55 | ||
| 40 | 56 | @classmethod | |
| 41 | 57 | def list_from_string(cls, repo, text): | |
| 58 | + """ | ||
| 59 | + Create a new diff object from the given text | ||
| 60 | + ``repo`` | ||
| 61 | + is the repository we are operating on - it is required | ||
| 62 | + | ||
| 63 | + ``text`` | ||
| 64 | + result of 'git diff' between two commits or one commit and the index | ||
| 65 | + | ||
| 66 | + Returns | ||
| 67 | + git.Diff[] | ||
| 68 | + """ | ||
| 42 | 69 | diffs = [] | |
| 43 | 70 | ||
| 44 | 71 | diff_header = re.compile(r""" | |
@@ -51,19 +78,19 @@ def list_from_string(cls, repo, text): | |||
| 51 | 78 | ^new[ ]mode[ ](?P<new_mode>\d+)(?:\n|$))? | |
| 52 | 79 | (?:^new[ ]file[ ]mode[ ](?P<new_file_mode>.+)(?:\n|$))? | |
| 53 | 80 | (?:^deleted[ ]file[ ]mode[ ](?P<deleted_file_mode>.+)(?:\n|$))? | |
| 54 | - (?:^index[ ](?P<a_commit>[0-9A-Fa-f]+) | ||
| 55 | - \.\.(?P<b_commit>[0-9A-Fa-f]+)[ ]?(?P<b_mode>.+)?(?:\n|$))? | ||
| 81 | + (?:^index[ ](?P<a_blob>[0-9A-Fa-f]+) | ||
| 82 | + \.\.(?P<b_blob>[0-9A-Fa-f]+)[ ]?(?P<b_mode>.+)?(?:\n|$))? | ||
| 56 | 83 | """, re.VERBOSE | re.MULTILINE).match | |
| 57 | 84 | ||
| 58 | 85 | for diff in ('\n' + text).split('\ndiff --git')[1:]: | |
| 59 | 86 | header = diff_header(diff) | |
| 60 | 87 | ||
| 61 | 88 | a_path, b_path, similarity_index, rename_from, rename_to, \ | |
| 62 | 89 | old_mode, new_mode, new_file_mode, deleted_file_mode, \ | |
| 63 | - a_commit, b_commit, b_mode = header.groups() | ||
| 90 | + a_blob, b_blob, b_mode = header.groups() | ||
| 64 | 91 | new_file, deleted_file = bool(new_file_mode), bool(deleted_file_mode) | |
| 65 | 92 | ||
| 66 | - diffs.append(Diff(repo, a_path, b_path, a_commit, b_commit, | ||
| 93 | + diffs.append(Diff(repo, a_path, b_path, a_blob, b_blob, | ||
| 67 | 94 | old_mode or deleted_file_mode, new_mode or new_file_mode or b_mode, | |
| 68 | 95 | new_file, deleted_file, rename_from, rename_to, diff[header.end():])) | |
| 69 | 96 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -69,6 +69,7 @@ def test_should_display_blame_information(self, git): | |||
| 69 | 69 | git.return_value = fixture('blame') | |
| 70 | 70 | b = Blob.blame(self.repo, 'master', 'lib/git.py') | |
| 71 | 71 | assert_equal(13, len(b)) | |
| 72 | + assert_equal( 2, len(b[0]) ) | ||
| 72 | 73 | # assert_equal(25, reduce(lambda acc, x: acc + len(x[-1]), b)) | |
| 73 | 74 | assert_equal(hash(b[0][0]), hash(b[9][0])) | |
| 74 | 75 | c = b[0][0] | |
@@ -83,6 +84,13 @@ def test_should_display_blame_information(self, git): | |||
| 83 | 84 | assert_equal('tom@mojombo.com', c.committer.email) | |
| 84 | 85 | assert_equal(time.gmtime(1191997100), c.committed_date) | |
| 85 | 86 | assert_equal('initial grit setup', c.message) | |
| 87 | + | ||
| 88 | + # test the 'lines per commit' entries | ||
| 89 | + tlist = b[0][1] | ||
| 90 | + assert_true( tlist ) | ||
| 91 | + assert_true( isinstance( tlist[0], basestring ) ) | ||
| 92 | + assert_true( len( tlist ) < sum( len(t) for t in tlist ) ) # test for single-char bug | ||
| 93 | + | ||
| 86 | 94 | ||
| 87 | 95 | def test_should_return_appropriate_representation(self): | |
| 88 | 96 | blob = Blob(self.repo, **{'id': 'abc'}) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,18 +37,19 @@ def test_diff(self, git): | |||
| 37 | 37 | ||
| 38 | 38 | assert_equal(15, len(diffs)) | |
| 39 | 39 | ||
| 40 | - assert_equal('.gitignore', diffs[0].a_path) | ||
| 41 | - assert_equal('.gitignore', diffs[0].b_path) | ||
| 42 | - assert_equal('4ebc8aea50e0a67e000ba29a30809d0a7b9b2666', diffs[0].a_commit.id) | ||
| 43 | - assert_equal('2dd02534615434d88c51307beb0f0092f21fd103', diffs[0].b_commit.id) | ||
| 44 | - assert_equal('100644', diffs[0].b_mode) | ||
| 40 | + assert_equal('.gitignore', diffs[0].a_blob.name) | ||
| 41 | + assert_equal('.gitignore', diffs[0].b_blob.name) | ||
| 42 | + assert_equal('4ebc8aea50e0a67e000ba29a30809d0a7b9b2666', diffs[0].a_blob.id) | ||
| 43 | + assert_equal('2dd02534615434d88c51307beb0f0092f21fd103', diffs[0].b_blob.id) | ||
| 44 | + assert_equal('100644', diffs[0].b_blob.mode) | ||
| 45 | 45 | assert_equal(False, diffs[0].new_file) | |
| 46 | 46 | assert_equal(False, diffs[0].deleted_file) | |
| 47 | 47 | assert_equal("--- a/.gitignore\n+++ b/.gitignore\n@@ -1 +1,2 @@\n coverage\n+pkg", diffs[0].diff) | |
| 48 | 48 | ||
| 49 | - assert_equal('lib/grit/actor.rb', diffs[5].a_path) | ||
| 50 | - assert_equal(None, diffs[5].a_commit) | ||
| 51 | - assert_equal('f733bce6b57c0e5e353206e692b0e3105c2527f4', diffs[5].b_commit.id) | ||
| 49 | + assert_equal('lib/grit/actor.rb', diffs[5].b_blob.name) | ||
| 50 | + assert_equal(None, diffs[5].a_blob) | ||
| 51 | + assert_equal('f733bce6b57c0e5e353206e692b0e3105c2527f4', diffs[5].b_blob.id) | ||
| 52 | + assert_equal( None, diffs[5].a_mode ) | ||
| 52 | 53 | assert_equal(True, diffs[5].new_file) | |
| 53 | 54 | ||
| 54 | 55 | assert_true(git.called) | |
@@ -88,7 +89,7 @@ def test_diff_with_files(self, git): | |||
| 88 | 89 | diffs = Commit.diff(self.repo, '59ddc32', ['lib']) | |
| 89 | 90 | ||
| 90 | 91 | assert_equal(1, len(diffs)) | |
| 91 | - assert_equal('lib/grit/diff.rb', diffs[0].a_path) | ||
| 92 | + assert_equal('lib/grit/diff.rb', diffs[0].a_blob.name) | ||
| 92 | 93 | ||
| 93 | 94 | assert_true(git.called) | |
| 94 | 95 | assert_equal(git.call_args, (('diff', '-M', '59ddc32', '--', 'lib'), {'full_index': True})) | |
@@ -100,7 +101,7 @@ def test_diff_with_two_commits_and_files(self, git): | |||
| 100 | 101 | diffs = Commit.diff(self.repo, '59ddc32', '13d27d5', ['lib']) | |
| 101 | 102 | ||
| 102 | 103 | assert_equal(1, len(diffs)) | |
| 103 | - assert_equal('lib/grit/commit.rb', diffs[0].a_path) | ||
| 104 | + assert_equal('lib/grit/commit.rb', diffs[0].a_blob.name) | ||
| 104 | 105 | ||
| 105 | 106 | assert_true(git.called) | |
| 106 | 107 | assert_equal(git.call_args, (('diff', '-M', '59ddc32', '13d27d5', '--', 'lib'), {'full_index': True})) | |
@@ -114,18 +115,18 @@ def test_diffs(self, git): | |||
| 114 | 115 | ||
| 115 | 116 | assert_equal(15, len(diffs)) | |
| 116 | 117 | ||
| 117 | - assert_equal('.gitignore', diffs[0].a_path) | ||
| 118 | - assert_equal('.gitignore', diffs[0].b_path) | ||
| 119 | - assert_equal('4ebc8aea50e0a67e000ba29a30809d0a7b9b2666', diffs[0].a_commit.id) | ||
| 120 | - assert_equal('2dd02534615434d88c51307beb0f0092f21fd103', diffs[0].b_commit.id) | ||
| 121 | - assert_equal('100644', diffs[0].b_mode) | ||
| 118 | + assert_equal('.gitignore', diffs[0].a_blob.name) | ||
| 119 | + assert_equal('.gitignore', diffs[0].b_blob.name) | ||
| 120 | + assert_equal('4ebc8aea50e0a67e000ba29a30809d0a7b9b2666', diffs[0].a_blob.id) | ||
| 121 | + assert_equal('2dd02534615434d88c51307beb0f0092f21fd103', diffs[0].b_blob.id) | ||
| 122 | + assert_equal('100644', diffs[0].b_blob.mode) | ||
| 122 | 123 | assert_equal(False, diffs[0].new_file) | |
| 123 | 124 | assert_equal(False, diffs[0].deleted_file) | |
| 124 | 125 | assert_equal("--- a/.gitignore\n+++ b/.gitignore\n@@ -1 +1,2 @@\n coverage\n+pkg", diffs[0].diff) | |
| 125 | 126 | ||
| 126 | - assert_equal('lib/grit/actor.rb', diffs[5].a_path) | ||
| 127 | - assert_equal(None, diffs[5].a_commit) | ||
| 128 | - assert_equal('f733bce6b57c0e5e353206e692b0e3105c2527f4', diffs[5].b_commit.id) | ||
| 127 | + assert_equal('lib/grit/actor.rb', diffs[5].b_blob.name) | ||
| 128 | + assert_equal(None, diffs[5].a_blob) | ||
| 129 | + assert_equal('f733bce6b57c0e5e353206e692b0e3105c2527f4', diffs[5].b_blob.id) | ||
| 129 | 130 | assert_equal(True, diffs[5].new_file) | |
| 130 | 131 | ||
| 131 | 132 | assert_true(git.called) | |
@@ -144,18 +145,17 @@ def test_diffs_on_initial_import(self, git): | |||
| 144 | 145 | ||
| 145 | 146 | assert_equal(10, len(diffs)) | |
| 146 | 147 | ||
| 147 | - assert_equal('History.txt', diffs[0].a_path) | ||
| 148 | - assert_equal('History.txt', diffs[0].b_path) | ||
| 149 | - assert_equal(None, diffs[0].a_commit) | ||
| 150 | - assert_equal('100644', diffs[0].b_mode) | ||
| 151 | - assert_equal('81d2c27608b352814cbe979a6acd678d30219678', diffs[0].b_commit.id) | ||
| 148 | + assert_equal('History.txt', diffs[0].b_blob.name) | ||
| 149 | + assert_equal(None, diffs[0].a_blob) | ||
| 150 | + assert_equal('100644', diffs[0].b_blob.mode) | ||
| 151 | + assert_equal('81d2c27608b352814cbe979a6acd678d30219678', diffs[0].b_blob.id) | ||
| 152 | 152 | assert_equal(True, diffs[0].new_file) | |
| 153 | 153 | assert_equal(False, diffs[0].deleted_file) | |
| 154 | 154 | assert_equal("--- /dev/null\n+++ b/History.txt\n@@ -0,0 +1,5 @@\n+== 1.0.0 / 2007-10-09\n+\n+* 1 major enhancement\n+ * Birthday!\n+", diffs[0].diff) | |
| 155 | 155 | ||
| 156 | - assert_equal('lib/grit.rb', diffs[5].a_path) | ||
| 157 | - assert_equal(None, diffs[5].a_commit) | ||
| 158 | - assert_equal('32cec87d1e78946a827ddf6a8776be4d81dcf1d1', diffs[5].b_commit.id) | ||
| 156 | + assert_equal('lib/grit.rb', diffs[5].b_blob.name) | ||
| 157 | + assert_equal(None, diffs[5].a_blob) | ||
| 158 | + assert_equal('32cec87d1e78946a827ddf6a8776be4d81dcf1d1', diffs[5].b_blob.id) | ||
| 159 | 159 | assert_equal(True, diffs[5].new_file) | |
| 160 | 160 | ||
| 161 | 161 | assert_true(git.called) | |
@@ -181,7 +181,10 @@ def test_diffs_with_mode_only_change(self, git): | |||
| 181 | 181 | commit.__bake_it__() | |
| 182 | 182 | diffs = commit.diffs | |
| 183 | 183 | ||
| 184 | + # in case of mode-only changes, there is no blob | ||
| 184 | 185 | assert_equal(23, len(diffs)) | |
| 186 | + assert_equal(None, diffs[0].a_blob) | ||
| 187 | + assert_equal(None, diffs[0].b_blob) | ||
| 185 | 188 | assert_equal('100644', diffs[0].a_mode) | |
| 186 | 189 | assert_equal('100755', diffs[0].b_mode) | |
| 187 | 190 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -185,18 +185,18 @@ def test_diff(self, git): | |||
| 185 | 185 | assert_equal(git.call_args, (('diff', 'master^', 'master', '--', 'foo/bar', 'foo/baz'), {})) | |
| 186 | 186 | ||
| 187 | 187 | @patch_object(Git, '_call_process') | |
| 188 | - def test_diff(self, git): | ||
| 188 | + def test_diff_with_parents(self, git): | ||
| 189 | 189 | git.return_value = fixture('diff_p') | |
| 190 | 190 | ||
| 191 | 191 | diffs = self.repo.commit_diff('master') | |
| 192 | 192 | assert_equal(15, len(diffs)) | |
| 193 | 193 | assert_true(git.called) | |
| 194 | 194 | ||
| 195 | 195 | def test_archive_tar(self): | |
| 196 | - assert self.repo.archive_tar() | ||
| 196 | + self.repo.archive_tar() | ||
| 197 | 197 | ||
| 198 | 198 | def test_archive_tar_gz(self): | |
| 199 | - assert self.repo.archive_tar_gz() | ||
| 199 | + self.repo.archive_tar_gz() | ||
| 200 | 200 | ||
| 201 | 201 | @patch('git.utils.touch') | |
| 202 | 202 | def test_enable_daemon_serve(self, touch): | |
@@ -207,52 +207,13 @@ def test_disable_daemon_serve(self): | |||
| 207 | 207 | self.repo.daemon_serve = True | |
| 208 | 208 | assert_true(self.repo.daemon_serve) | |
| 209 | 209 | ||
| 210 | - # @patch_object(os.path, 'exists') | ||
| 211 | - # @patch_object('__builtin__', 'open') | ||
| 212 | - # def test_alternates_with_two_alternates(self, exists, read): | ||
| 213 | - # # File.expects(:exist?).with("#{absolute_project_path}/.git/objects/info/alternates").returns(true) | ||
| 214 | - # # File.expects(:read).returns("/path/to/repo1/.git/objects\n/path/to/repo2.git/objects\n") | ||
| 215 | - # exists.return_value = True | ||
| 216 | - # read.return_value = ("/path/to/repo1/.git/objects\n/path/to/repo2.git/objects\n") | ||
| 217 | - # | ||
| 218 | - # assert_equal(["/path/to/repo1/.git/objects", "/path/to/repo2.git/objects"], self.repo.alternates) | ||
| 219 | - # | ||
| 220 | - # assert_true(exists.called) | ||
| 221 | - # assert_true(read.called) | ||
| 222 | - # | ||
| 223 | 210 | @patch_object(os.path, 'exists') | |
| 224 | 211 | def test_alternates_no_file(self, os): | |
| 225 | 212 | os.return_value = False | |
| 226 | 213 | assert_equal([], self.repo.alternates) | |
| 227 | 214 | ||
| 228 | 215 | assert_true(os.called) | |
| 229 | 216 | ||
| 230 | - # @patch_object(os.path, 'exists') | ||
| 231 | - # def test_alternates_setter_ok(self, os): | ||
| 232 | - # os.return_value = True | ||
| 233 | - # alts = ['/path/to/repo.git/objects', '/path/to/repo2.git/objects'] | ||
| 234 | - # | ||
| 235 | - # # File.any_instance.expects(:write).with(alts.join("\n")) | ||
| 236 | - # | ||
| 237 | - # self.repo.alternates = alts | ||
| 238 | - # | ||
| 239 | - # assert_true(os.called) | ||
| 240 | - # # assert_equal(os.call_args, ((alts,), {})) | ||
| 241 | - # # for alt in alts: | ||
| 242 | - # | ||
| 243 | - # @patch_object(os.path, 'exists') | ||
| 244 | - # @raises(NoSuchPathError) | ||
| 245 | - # def test_alternates_setter_bad(self, os): | ||
| 246 | - # os.return_value = False | ||
| 247 | - # | ||
| 248 | - # alts = ['/path/to/repo.git/objects'] | ||
| 249 | - # # File.any_instance.expects(:write).never | ||
| 250 | - # self.repo.alternates = alts | ||
| 251 | - # | ||
| 252 | - # for alt in alts: | ||
| 253 | - # assert_true(os.called) | ||
| 254 | - # assert_equal(os.call_args, (alt, {})) | ||
| 255 | - | ||
| 256 | 217 | @patch_object(os, 'remove') | |
| 257 | 218 | def test_alternates_setter_empty(self, os): | |
| 258 | 219 | self.repo.alternates = [] | |
@@ -278,33 +239,6 @@ def test_log_with_path_and_options(self, git): | |||
| 278 | 239 | assert_true(git.called) | |
| 279 | 240 | assert_equal(git.call_args, (('log', 'master', '--', 'file.rb'), {'pretty': 'raw', 'max_count': 1})) | |
| 280 | 241 | ||
| 281 | - # @patch_object(Git, '_call_process') | ||
| 282 | - # @patch_object(Git, '_call_process') | ||
| 283 | - # def test_commit_deltas_from_nothing_new(self, gitb, gita): | ||
| 284 | - # gitb.return_value = fixture("rev_list_delta_b") | ||
| 285 | - # gita.return_value = fixture("rev_list_delta_a") | ||
| 286 | - # other_repo = Repo(GIT_REPO) | ||
| 287 | - # # self.repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_b")) | ||
| 288 | - # # other_repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_a")) | ||
| 289 | - # | ||
| 290 | - # delta_commits = self.repo.commit_deltas_from(other_repo) | ||
| 291 | - # assert_equal(0, len(delta_commits)) | ||
| 292 | - # assert_true(gitb.called) | ||
| 293 | - # assert_equal(gitb.call_args, (('rev_list', 'master'), {})) | ||
| 294 | - # assert_true(gita.called) | ||
| 295 | - # assert_equal(gita.call_args, (('rev_list', 'master'), {})) | ||
| 296 | - # | ||
| 297 | - # def test_commit_deltas_from_when_other_has_new(self): | ||
| 298 | - # other_repo = Repo(GIT_REPO) | ||
| 299 | - # # self.repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_a")) | ||
| 300 | - # # other_repo.git.expects(:rev_list).with({}, "master").returns(fixture("rev_list_delta_b")) | ||
| 301 | - # # for ref in ['4c8124ffcf4039d292442eeccabdeca5af5c5017', | ||
| 302 | - # # '634396b2f541a9f2d58b00be1a07f0c358b999b3', | ||
| 303 | - # # 'ab25fd8483882c3bda8a458ad2965d2248654335']: | ||
| 304 | - # # Commit.expects(:find_all).with(other_repo, ref, :max_count => 1).returns([stub()]) | ||
| 305 | - # delta_commits = self.repo.commit_deltas_from(other_repo) | ||
| 306 | - # assert_equal(3, len(delta_commits)) | ||
| 307 | - | ||
| 308 | 242 | def test_is_dirty_with_bare_repository(self): | |
| 309 | 243 | self.repo.bare = True | |
| 310 | 244 | assert_false(self.repo.is_dirty) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments