{"thread":{"id":"20893","subject":"[PATCH v2] git-p4: Avoid modules deprecated in Python 2.6.","startedAt":"2009-09-10T07:02:38Z","lastAt":"2009-09-10T18:22:37Z","messageCount":2,"participants":["Reilly Grant","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"122793","messageId":"1252566158-13305-1-git-send-email-reillyeon@qotw.net","threadId":"20893","inReplyTo":null,"subject":"[PATCH v2] git-p4: Avoid modules deprecated in Python 2.6.","fromName":"Reilly Grant","fromEmail":"reillyeon@qotw.net","sentAt":"2009-09-10T07:02:38Z","receivedAt":"2009-09-10T07:02:38Z","isPatch":true,"sender":{"key":"reillyeon@qotw.net","avatar":"https://gravatar.com/avatar/6b892ba69df7eecbcbfca640eacc5d62f407df3cf637db63b27a28c3ce8801cf?d=mp&s=160"},"body":"The popen2, sha and sets modules are deprecated in Python 2.6 (sha in\nPython 2.5).  Both popen2 and sha are not actually used in git-p4.\nReplace usage of sets.Set with the builtin set object.\n\nThe built-in set object was added in Python 2.4 and is already used in\nother parts of this script, so this dependency is nothing new.\n\nSigned-off-by: Reilly Grant <reillyeon@qotw.net>\n---\n contrib/fast-import/git-p4 |   12 +++++-------\n 1 files changed, 5 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 38438f3..e710219 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -8,12 +8,10 @@\n # License: MIT <http://www.opensource.org/licenses/mit-license.php>\n #\n \n-import optparse, sys, os, marshal, popen2, subprocess, shelve\n-import tempfile, getopt, sha, os.path, time, platform\n+import optparse, sys, os, marshal, subprocess, shelve\n+import tempfile, getopt, os.path, time, platform\n import re\n \n-from sets import Set;\n-\n verbose = False\n \n \n@@ -864,8 +862,8 @@ class P4Sync(Command):\n \n         self.usage += \" //depot/path[@revRange]\"\n         self.silent = False\n-        self.createdBranches = Set()\n-        self.committedChanges = Set()\n+        self.createdBranches = set()\n+        self.committedChanges = set()\n         self.branch = \"\"\n         self.detectBranches = False\n         self.detectLabels = False\n@@ -1662,7 +1660,7 @@ class P4Sync(Command):\n \n             if len(self.changesFile) > 0:\n                 output = open(self.changesFile).readlines()\n-                changeSet = Set()\n+                changeSet = set()\n                 for line in output:\n                     changeSet.add(int(line))\n \n-- \n1.6.3.3\n"},{"id":"122825","messageId":"7v63bqd5hu.fsf@alter.siamese.dyndns.org","threadId":"20893","inReplyTo":"1252566158-13305-1-git-send-email-reillyeon@qotw.net","subject":"Re: [PATCH v2] git-p4: Avoid modules deprecated in Python 2.6.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-09-10T18:22:37Z","receivedAt":"2009-09-10T18:22:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Reilly Grant <reillyeon@qotw.net> writes:\n\n> The popen2, sha and sets modules are deprecated in Python 2.6 (sha in\n> Python 2.5).  Both popen2 and sha are not actually used in git-p4.\n> Replace usage of sets.Set with the builtin set object.\n>\n> The built-in set object was added in Python 2.4 and is already used in\n> other parts of this script, so this dependency is nothing new.\n\nThanks for a resend.  Will apply.\n"}]}