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

Commit41e9781

Browse files
committed
Improve BlameEntry.commit typing
1 parent53f1195 commit41e9781

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎git/config.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
fromtypingimport (Any,Callable,IO,List,Dict,Sequence,
3535
TYPE_CHECKING,Tuple,Union,cast,overload)
3636

37-
fromgit.typesimportLit_config_levels,ConfigLevels_Tup,ConfigLevels_NT,PathLike,TBD,assert_never
37+
fromgit.typesimportLit_config_levels,ConfigLevels_Tup,PathLike,TBD,assert_never
3838

3939
ifTYPE_CHECKING:
4040
fromgit.repo.baseimportRepo
@@ -51,7 +51,7 @@
5151
# represents the configuration level of a configuration file
5252

5353

54-
CONFIG_LEVELS:ConfigLevels_Tup=ConfigLevels_NT("system","user","global","repository")
54+
CONFIG_LEVELS:ConfigLevels_Tup= ("system","user","global","repository")
5555

5656
# Section pattern to detect conditional includes.
5757
# https://git-scm.com/docs/git-config#_conditional_includes

‎git/repo/base.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# typing ------------------------------------------------------
3838

39-
fromgit.typesimportConfigLevels_NT,TBD,PathLike,Lit_config_levels,Commit_ish,Tree_ish
39+
fromgit.typesimportTBD,PathLike,Lit_config_levels,Commit_ish,Tree_ish
4040
fromtypingimport (Any,BinaryIO,Callable,Dict,
4141
Iterator,List,Mapping,Optional,Sequence,
4242
TextIO,Tuple,Type,Union,
@@ -58,7 +58,7 @@
5858

5959

6060
classBlameEntry(NamedTuple):
61-
commit:Dict[str,TBD]
61+
commit:Dict[str,'Commit']
6262
linenos:range
6363
orig_path:Optional[str]
6464
orig_linenos:range
@@ -96,7 +96,7 @@ class Repo(object):
9696

9797
# invariants
9898
# represents the configuration level of a configuration file
99-
config_level:ConfigLevels_Tup=ConfigLevels_NT("system","user","global","repository")
99+
config_level:ConfigLevels_Tup= ("system","user","global","repository")
100100

101101
# Subclass configuration
102102
# Subclasses may easily bring in their own custom types by placing a constructor or type here
@@ -802,7 +802,7 @@ def blame_incremental(self, rev: TBD, file: TBD, **kwargs: Any) -> Optional[Iter
802802
should get a continuous range spanning all line numbers in the file.
803803
"""
804804
data=self.git.blame(rev,'--',file,p=True,incremental=True,stdout_as_string=False,**kwargs)
805-
commits= {}# type: Dict[str,TBD]
805+
commits:Dict[str,Commit]= {}
806806

807807
stream= (lineforlineindata.split(b'\n')ifline)
808808
whileTrue:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp