Skip to content

Commit 66b559d

Browse files
zzl0meta-codesync[bot]
authored andcommitted
sapling: remove unused Python imports
Summary: Remove unused imports across several sapling/ Python files, identified by the RemoveUnusedImportsWithGlean codemod. Removed imports: `os` and `defaultdict` from subtree.py, `hashlib` and `sys` from context.py, `sys` from encoding.py and httpclient/__init__.py, `error`/`getdefaultmaxuntrackedsize`/`parsemaxuntracked`/`parsemaxuntrackedbytes`/`fetchsnapshot` from snapshot/latest.py, `errno` and `stat` from pathutil.py, and `getpass` from posix.py. Reviewed By: VladimirMakaev Differential Revision: D101266570 fbshipit-source-id: 6299c492ea99f6e2d1b6717f814e72e27a2830e7
1 parent fa7f235 commit 66b559d

7 files changed

Lines changed: 3 additions & 18 deletions

File tree

eden/scm/sapling/commands/subtree.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55

66
import contextlib
77
import json
8-
import os
98
import shutil
109
import tempfile
11-
from collections import defaultdict
1210
from typing import List
1311

1412
from .. import (

eden/scm/sapling/context.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313

1414
import errno
1515
import filecmp
16-
import hashlib
1716
import os
1817
import re
1918
import stat
20-
import sys
2119
from functools import partial
2220
from typing import Callable, List, Optional, Tuple, Union
2321

eden/scm/sapling/encoding.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import locale
1515
import os
16-
import sys
1716
import unicodedata
1817

1918
import bindings

eden/scm/sapling/ext/snapshot/latest.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@
33
# This software may be used and distributed according to the terms of the
44
# GNU General Public License version 2.
55

6-
from sapling import error, node
6+
from sapling import node
77
from sapling.edenapi_upload import filetypefromfile
88
from sapling.i18n import _
99

10-
from .createremote import (
11-
getdefaultmaxuntrackedsize,
12-
parsemaxuntracked,
13-
parsemaxuntrackedbytes,
14-
workingcopy,
15-
)
10+
from .createremote import workingcopy
1611
from .metalog import fetchlatestsnapshot
17-
from .update import fetchsnapshot
1812

1913

2014
def _isworkingcopy(ui, repo, snapshot, maxuntrackedsize, pats=None, opts=None):

eden/scm/sapling/httpclient/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
import select
5454
import socket
5555
import ssl
56-
import sys
5756

5857
from .. import util
5958
from . import _readers

eden/scm/sapling/pathutil.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
# This software may be used and distributed according to the terms of the
99
# GNU General Public License version 2 or any later version.
1010

11-
import errno
1211
import os
1312
import posixpath
14-
import stat
1513

1614
import bindings
1715

18-
from . import encoding, error, identity, util
16+
from . import encoding, error, util
1917
from .i18n import _
2018

2119

eden/scm/sapling/posix.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import errno
1717
import fcntl
18-
import getpass
1918
import grp
2019
import os
2120
import pwd

0 commit comments

Comments
 (0)