Mercurial > hgsubversion
comparison hgsubversion/stupid.py @ 409:d4615986e1db
extract the filemap support into a separate class
| author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
|---|---|
| date | Thu, 11 Jun 2009 18:52:30 +0200 |
| parents | f137231f9d30 |
| children | eb524b957345 |
comparison
equal
deleted
inserted
replaced
| 408:f137231f9d30 | 409:d4615986e1db |
|---|---|
| 80 iterhunks = patch.iterhunks | 80 iterhunks = patch.iterhunks |
| 81 def filterhunks(ui, fp, sourcefile=None): | 81 def filterhunks(ui, fp, sourcefile=None): |
| 82 applycurrent = False | 82 applycurrent = False |
| 83 for data in iterhunks(ui, fp, sourcefile): | 83 for data in iterhunks(ui, fp, sourcefile): |
| 84 if data[0] == 'file': | 84 if data[0] == 'file': |
| 85 if hg_editor._is_file_included(data[1][1]): | 85 if data[1][1] in hg_editor.filemap: |
| 86 applycurrent = True | 86 applycurrent = True |
| 87 else: | 87 else: |
| 88 applycurrent = False | 88 applycurrent = False |
| 89 assert data[0] != 'git', 'Filtering git hunks not supported.' | 89 assert data[0] != 'git', 'Filtering git hunks not supported.' |
| 90 if applycurrent: | 90 if applycurrent: |
| 583 raise IOError() | 583 raise IOError() |
| 584 return filectxfn2(repo, memctx, path) | 584 return filectxfn2(repo, memctx, path) |
| 585 | 585 |
| 586 if '' in files_touched: | 586 if '' in files_touched: |
| 587 files_touched.remove('') | 587 files_touched.remove('') |
| 588 excluded = [f for f in files_touched | 588 excluded = [f for f in files_touched if f not in hg_editor.filemap] |
| 589 if not hg_editor._is_file_included(f)] | |
| 590 for f in excluded: | 589 for f in excluded: |
| 591 files_touched.remove(f) | 590 files_touched.remove(f) |
| 592 | 591 |
| 593 if parentctx.node() == node.nullid and not files_touched: | 592 if parentctx.node() == node.nullid and not files_touched: |
| 594 continue | 593 continue |
