Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c6ae2b

Browse files
committed
Try to distinguation git.diff module from diff.Diff.diff and diff.Daffable.diff()
1 parent6271660 commit7c6ae2b

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

‎git/diff.py‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -212,19 +212,19 @@ def iter_change_type(self, change_type: Lit_change_type) -> Iterator[T_Diff]:
212212
ifchange_typenotinself.change_type:
213213
raiseValueError("Invalid change type: %s"%change_type)
214214

215-
fordiffinself:
216-
ifdiff.change_type==change_type:
217-
yielddiff
218-
elifchange_type=="A"anddiff.new_file:
219-
yielddiff
220-
elifchange_type=="D"anddiff.deleted_file:
221-
yielddiff
222-
elifchange_type=="C"anddiff.copied_file:
223-
yielddiff
224-
elifchange_type=="R"anddiff.renamed:
225-
yielddiff
226-
elifchange_type=="M"anddiff.a_blobanddiff.b_blobanddiff.a_blob!=diff.b_blob:
227-
yielddiff
215+
fordiffidxinself:
216+
ifdiffidx.change_type==change_type:
217+
yielddiffidx
218+
elifchange_type=="A"anddiffidx.new_file:
219+
yielddiffidx
220+
elifchange_type=="D"anddiffidx.deleted_file:
221+
yielddiffidx
222+
elifchange_type=="C"anddiffidx.copied_file:
223+
yielddiffidx
224+
elifchange_type=="R"anddiffidx.renamed:
225+
yielddiffidx
226+
elifchange_type=="M"anddiffidx.a_blobanddiffidx.b_blobanddiffidx.a_blob!=diffidx.b_blob:
227+
yielddiffidx
228228
# END for each diff
229229

230230

‎git/index/base.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
fromgitdb.baseimportIStream
4242
fromgitdb.dbimportMemoryDB
4343

44-
importgit.diffasdiff
44+
importgit.diffasgit_diff
4545
importos.pathasosp
4646

4747
from .funimport (
@@ -88,7 +88,7 @@
8888
__all__= ('IndexFile','CheckoutError')
8989

9090

91-
classIndexFile(LazyMixin,diff.Diffable,Serializable):
91+
classIndexFile(LazyMixin,git_diff.Diffable,Serializable):
9292

9393
"""
9494
Implements an Index that can be manipulated using a native implementation in
@@ -575,8 +575,8 @@ def write_tree(self) -> Tree:
575575
root_tree._cache=tree_items# type: ignore
576576
returnroot_tree
577577

578-
def_process_diff_args(self,args:List[Union[str,diff.Diffable,object]]
579-
)->List[Union[str,diff.Diffable,object]]:
578+
def_process_diff_args(self,args:List[Union[str,git_diff.Diffable,object]]
579+
)->List[Union[str,git_diff.Diffable,object]]:
580580
try:
581581
args.pop(args.index(self))
582582
exceptIndexError:
@@ -1272,10 +1272,11 @@ def reset(self, commit: Union[Commit, 'Reference', str] = 'HEAD', working_tree:
12721272
returnself
12731273

12741274
@default_index
1275-
defdiff(self,other:Union[diff.Diffable.Index,'IndexFile.Index',Treeish,None,object]=diff.Diffable.Index,
1275+
defdiff(self,
1276+
other:Union[git_diff.Diffable.Index,'IndexFile.Index',Treeish,None,object]=git_diff.Diffable.Index,
12761277
paths:Union[str,List[PathLike],Tuple[PathLike, ...],None]=None,
12771278
create_patch:bool=False,**kwargs:Any
1278-
)->diff.DiffIndex:
1279+
)->git_diff.DiffIndex:
12791280
"""Diff this index against the working copy or a Tree or Commit object
12801281
12811282
For a documentation of the parameters and return values, see,
@@ -1287,7 +1288,7 @@ def diff(self, other: Union[diff.Diffable.Index, 'IndexFile.Index', Treeish, Non
12871288
"""
12881289
# index against index is always empty
12891290
ifotherisself.Index:
1290-
returndiff.DiffIndex()
1291+
returngit_diff.DiffIndex()
12911292

12921293
# index against anything but None is a reverse diff with the respective
12931294
# item. Handle existing -R flags properly. Transform strings to the object

‎git/objects/tree.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
66

77
fromgit.utilimportIterableList,join_path
8-
importgit.diffasdiff
8+
importgit.diffasgit_diff
99
fromgit.utilimportto_bin_sha
1010

1111
from .importutil
@@ -180,7 +180,7 @@ def __delitem__(self, name: str) -> None:
180180
#} END mutators
181181

182182

183-
classTree(IndexObject,diff.Diffable,util.Traversable,util.Serializable):
183+
classTree(IndexObject,git_diff.Diffable,util.Traversable,util.Serializable):
184184

185185
"""Tree objects represent an ordered list of Blobs and other Trees.
186186

‎git/remote.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def __getattr__(self, attr: str) -> Any:
469469
def_config_section_name(self)->str:
470470
return'remote "%s"'%self.name
471471

472-
def_set_cache_(self,attr:str)->Any:
472+
def_set_cache_(self,attr:str)->None:
473473
ifattr=="_config_reader":
474474
# NOTE: This is cached as __getattr__ is overridden to return remote config values implicitly, such as
475475
# in print(r.pushurl)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp