@@ -121,7 +121,7 @@ def _set_cache_(self, attr):
121121 ok = True
122122 except OSError :
123123 # in new repositories, there may be no index, which means we are empty
124- self .entries = dict ()
124+ self .entries = {}
125125 return
126126 finally :
127127 if not ok :
@@ -324,7 +324,7 @@ def from_tree(cls, repo, *treeish, **kwargs):
324324 if len (treeish ) == 0 or len (treeish ) > 3 :
325325 raise ValueError ("Please specify between 1 and 3 treeish, got %i" % len (treeish ))
326326
327- arg_list = list ()
327+ arg_list = []
328328 # ignore that working tree and index possibly are out of date
329329 if len (treeish ) > 1 :
330330 # drop unmerged entries when reading our index and merging
@@ -471,9 +471,9 @@ def unmerged_blobs(self):
471471 are at stage 3 will not have a stage 3 entry.
472472 """
473473 is_unmerged_blob = lambda t : t [0 ] != 0
474- path_map = dict ()
474+ path_map = {}
475475 for stage , blob in self .iter_blobs (is_unmerged_blob ):
476- path_map .setdefault (blob .path , list () ).append ((stage , blob ))
476+ path_map .setdefault (blob .path , [] ).append ((stage , blob ))
477477 # END for each unmerged blob
478478 for l in mviter (path_map ):
479479 l .sort ()
@@ -576,8 +576,8 @@ def _to_relative_path(self, path):
576576
577577 def _preprocess_add_items (self , items ):
578578 """ Split the items into two lists of path strings and BaseEntries. """
579- paths = list ()
580- entries = list ()
579+ paths = []
580+ entries = []
581581
582582 for item in items :
583583 if isinstance (item , string_types ):
@@ -610,7 +610,7 @@ def _store_path(self, filepath, fprogress):
610610 @unbare_repo
611611 @git_working_dir
612612 def _entries_for_paths (self , paths , path_rewriter , fprogress , entries ):
613- entries_added = list ()
613+ entries_added = []
614614 if path_rewriter :
615615 for path in paths :
616616 if osp .isabs (path ):
@@ -742,7 +742,7 @@ def add(self, items, force=True, fprogress=lambda *args: None, path_rewriter=Non
742742 # automatically
743743 # paths can be git-added, for everything else we use git-update-index
744744 paths , entries = self ._preprocess_add_items (items )
745- entries_added = list ()
745+ entries_added = []
746746 # This code needs a working tree, therefore we try not to run it unless required.
747747 # That way, we are OK on a bare repository as well.
748748 # If there are no paths, the rewriter has nothing to do either
@@ -809,7 +809,7 @@ def handle_null_entries(self):
809809 def _items_to_rela_paths (self , items ):
810810 """Returns a list of repo-relative paths from the given items which
811811 may be absolute or relative paths, entries or blobs"""
812- paths = list ()
812+ paths = []
813813 for item in items :
814814 if isinstance (item , (BaseIndexEntry , (Blob , Submodule ))):
815815 paths .append (self ._to_relative_path (item .path ))
@@ -858,7 +858,7 @@ def remove(self, items, working_tree=False, **kwargs):
858858 been removed effectively.
859859 This is interesting to know in case you have provided a directory or
860860 globs. Paths are relative to the repository. """
861- args = list ()
861+ args = []
862862 if not working_tree :
863863 args .append ("--cached" )
864864 args .append ("--" )
@@ -897,7 +897,7 @@ def move(self, items, skip_errors=False, **kwargs):
897897
898898 :raise ValueError: If only one item was given
899899 GitCommandError: If git could not handle your request"""
900- args = list ()
900+ args = []
901901 if skip_errors :
902902 args .append ('-k' )
903903
@@ -910,7 +910,7 @@ def move(self, items, skip_errors=False, **kwargs):
910910
911911 # first execute rename in dryrun so the command tells us what it actually does
912912 # ( for later output )
913- out = list ()
913+ out = []
914914 mvlines = self .repo .git .mv (args , paths , ** kwargs ).splitlines ()
915915
916916 # parse result - first 0:n/2 lines are 'checking ', the remaining ones
@@ -1041,9 +1041,9 @@ def handle_stderr(proc, iter_checked_out_files):
10411041 # line contents:
10421042 stderr = stderr .decode (defenc )
10431043 # git-checkout-index: this already exists
1044- failed_files = list ()
1045- failed_reasons = list ()
1046- unknown_lines = list ()
1044+ failed_files = []
1045+ failed_reasons = []
1046+ unknown_lines = []
10471047 endings = (' already exists' , ' is not in the cache' , ' does not exist at stage' , ' is unmerged' )
10481048 for line in stderr .splitlines ():
10491049 if not line .startswith ("git checkout-index: " ) and not line .startswith ("git-checkout-index: " ):
@@ -1106,7 +1106,7 @@ def handle_stderr(proc, iter_checked_out_files):
11061106 proc = self .repo .git .checkout_index (args , ** kwargs )
11071107 # FIXME: Reading from GIL!
11081108 make_exc = lambda : GitCommandError (("git-checkout-index" ,) + tuple (args ), 128 , proc .stderr .read ())
1109- checked_out_files = list ()
1109+ checked_out_files = []
11101110
11111111 for path in paths :
11121112 co_path = to_native_path_linux (self ._to_relative_path (path ))
0 commit comments