Skip to content

Commit

Permalink
git-p4: Avoid modules deprecated in Python 2.6.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Reilly Grant authored and Junio C Hamano committed Sep 10, 2009
1 parent 0460dba commit 1d7367d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions contrib/fast-import/git-p4
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
# License: MIT <http://www.opensource.org/licenses/mit-license.php>
#

import optparse, sys, os, marshal, popen2, subprocess, shelve
import tempfile, getopt, sha, os.path, time, platform
import optparse, sys, os, marshal, subprocess, shelve
import tempfile, getopt, os.path, time, platform
import re

from sets import Set;

verbose = False


Expand Down Expand Up @@ -864,8 +862,8 @@ class P4Sync(Command):

self.usage += " //depot/path[@revRange]"
self.silent = False
self.createdBranches = Set()
self.committedChanges = Set()
self.createdBranches = set()
self.committedChanges = set()
self.branch = ""
self.detectBranches = False
self.detectLabels = False
Expand Down Expand Up @@ -1662,7 +1660,7 @@ class P4Sync(Command):

if len(self.changesFile) > 0:
output = open(self.changesFile).readlines()
changeSet = Set()
changeSet = set()
for line in output:
changeSet.add(int(line))

Expand Down

0 comments on commit 1d7367d

Please sign in to comment.