|
39 | 39 | ) |
40 | 40 |
|
41 | 41 | fromgit.objects.utilimportSerializable |
42 | | -fromgit.compatimportizip |
| 42 | +fromgit.compatimport ( |
| 43 | +izip, |
| 44 | +xrange, |
| 45 | +string_types, |
| 46 | +) |
43 | 47 |
|
44 | 48 | fromgit.utilimport ( |
45 | 49 | LazyMixin, |
@@ -541,7 +545,7 @@ def _preprocess_add_items(self, items): |
541 | 545 | entries=list() |
542 | 546 |
|
543 | 547 | foriteminitems: |
544 | | -ifisinstance(item,basestring): |
| 548 | +ifisinstance(item,string_types): |
545 | 549 | paths.append(self._to_relative_path(item)) |
546 | 550 | elifisinstance(item, (Blob,Submodule)): |
547 | 551 | entries.append(BaseIndexEntry.from_blob(item)) |
@@ -752,7 +756,7 @@ def _items_to_rela_paths(self, items): |
752 | 756 | foriteminitems: |
753 | 757 | ifisinstance(item, (BaseIndexEntry, (Blob,Submodule))): |
754 | 758 | paths.append(self._to_relative_path(item.path)) |
755 | | -elifisinstance(item,basestring): |
| 759 | +elifisinstance(item,string_types): |
756 | 760 | paths.append(self._to_relative_path(item)) |
757 | 761 | else: |
758 | 762 | raiseTypeError("Invalid item type: %r"%item) |
@@ -1004,7 +1008,7 @@ def handle_stderr(proc, iter_checked_out_files): |
1004 | 1008 | handle_stderr(proc,rval_iter) |
1005 | 1009 | returnrval_iter |
1006 | 1010 | else: |
1007 | | -ifisinstance(paths,basestring): |
| 1011 | +ifisinstance(paths,string_types): |
1008 | 1012 | paths= [paths] |
1009 | 1013 |
|
1010 | 1014 | # make sure we have our entries loaded before we start checkout_index |
@@ -1140,7 +1144,7 @@ def diff(self, other=diff.Diffable.Index, paths=None, create_patch=False, **kwar |
1140 | 1144 | # index against anything but None is a reverse diff with the respective |
1141 | 1145 | # item. Handle existing -R flags properly. Transform strings to the object |
1142 | 1146 | # so that we can call diff on it |
1143 | | -ifisinstance(other,basestring): |
| 1147 | +ifisinstance(other,string_types): |
1144 | 1148 | other=self.repo.rev_parse(other) |
1145 | 1149 | # END object conversion |
1146 | 1150 |
|
|