@matheusbsbs / matheus-bagliano / commits / 1d7367dce7
Fork 0

git-p4: Avoid modules deprecated in Python 2.6.

The popen2, sha and sets modules are deprecated in Python 2.6 (sha in Python 2.5). Both popen2 and sha are not actually used in git-p4. Replace usage of sets.Set with the builtin set object. The built-in set object was added in Python 2.4 and is already used in other parts of this script, so this dependency is nothing new. Signed-off-by: Reilly Grant <reillyeon@qotw.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Reilly Grant committed Sep 10, 2009 at 00:02 UTC 1d7367dce7b55cbb1804c4863c56bd20ab12bda8
1 file changed +5 -7
contrib/fast-import/git-p4
+5 -7
@@ -8,12 +8,10 @@
8 # License: MIT <http://www.opensource.org/licenses/mit-license.php>
9 #
10
11 -import optparse, sys, os, marshal, popen2, subprocess, shelve
12 -import tempfile, getopt, sha, os.path, time, platform
11 +import optparse, sys, os, marshal, subprocess, shelve
12 +import tempfile, getopt, os.path, time, platform
13 import re
14
15 -from sets import Set;
16 -
15 verbose = False
16
17
@@ -864,8 +862,8 @@ class P4Sync(Command):
862
863 self.usage += " //depot/path[@revRange]"
864 self.silent = False
867 - self.createdBranches = Set()
868 - self.committedChanges = Set()
865 + self.createdBranches = set()
866 + self.committedChanges = set()
867 self.branch = ""
868 self.detectBranches = False
869 self.detectLabels = False
@@ -1662,7 +1660,7 @@ class P4Sync(Command):
1660
1661 if len(self.changesFile) > 0:
1662 output = open(self.changesFile).readlines()
1665 - changeSet = Set()
1663 + changeSet = set()
1664 for line in output:
1665 changeSet.add(int(line))
1666