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

Commit683a3ee

Browse files
committed
Clean up git.objects.submodule.base imports
This reorders them lexicographically within each group, makesspacing/formatting more consistent, and removes the old commentabout needing a dict to set .name, which had originally been onwhat later became the BytesIO import but had become separate fromit. (In Python 2, there was a cStringIO type, which could provide aspeed advantage over StringIO, but its instances, not havinginstance dictionaries, didn't support the dynamic creation of newattributes. This was changed to StringIO in00ce31a to allow .nameto be added. It was changed to BytesIO inbc8c912 to work withbytes on both Python 2 and Python 3. The comment about needing adict later ended up on the preceding line in0210e39, at whichpoint its meaning was unclear. Because Python 2 is no longersupported and Python 3 has no cStringIO type, the comment is nolonger needed, and this commit removes it.)
1 parent5039df3 commit683a3ee

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

‎git/objects/submodule/base.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,37 @@
1-
# need a dict to set bloody .name field
21
fromioimportBytesIO
32
importlogging
43
importos
4+
importos.pathasosp
55
importstat
66
importuuid
77

88
importgit
99
fromgit.cmdimportGit
10-
fromgit.compatimport (
11-
defenc,
12-
is_win,
13-
)
14-
fromgit.configimportSectionConstraint,GitConfigParser,cp
10+
fromgit.compatimportdefenc,is_win
11+
fromgit.configimportGitConfigParser,SectionConstraint,cp
1512
fromgit.excimport (
13+
BadName,
1614
InvalidGitRepositoryError,
1715
NoSuchPathError,
1816
RepositoryDirtyError,
19-
BadName,
2017
)
2118
fromgit.objects.baseimportIndexObject,Object
2219
fromgit.objects.utilimportTraversableIterableObj
23-
2420
fromgit.utilimport (
25-
join_path_native,
26-
to_native_path_linux,
21+
IterableList,
2722
RemoteProgress,
23+
join_path_native,
2824
rmtree,
25+
to_native_path_linux,
2926
unbare_repo,
30-
IterableList,
3127
)
3228

33-
importos.pathasosp
34-
3529
from .utilimport (
30+
SubmoduleConfigParser,
31+
find_first_remote_branch,
3632
mkhead,
3733
sm_name,
3834
sm_section,
39-
SubmoduleConfigParser,
40-
find_first_remote_branch,
4135
)
4236

4337

‎test/test_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def tearDown(self):
2222
gc.collect()
2323

2424
# ACTUALLY skipped by git.util.rmtree (in local onerror function), from the last call to it via
25-
# git.objects.submodule.base.Submodule.remove (at "handle separate bare repository"), line1068.
25+
# git.objects.submodule.base.Submodule.remove (at "handle separate bare repository"), line1062.
2626
#
2727
# @skipIf(HIDE_WINDOWS_KNOWN_ERRORS,
2828
# "FIXME: helper.wrapper fails with: PermissionError: [WinError 5] Access is denied: "

‎test/test_submodule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def _do_base_tests(self, rwrepo):
458458
)
459459

460460
# ACTUALLY skipped by git.util.rmtree (in local onerror function), called via
461-
# git.objects.submodule.base.Submodule.remove at "method(mp)", line1017.
461+
# git.objects.submodule.base.Submodule.remove at "method(mp)", line1011.
462462
#
463463
# @skipIf(HIDE_WINDOWS_KNOWN_ERRORS,
464464
# "FIXME: fails with: PermissionError: [WinError 32] The process cannot access the file because"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp