[asterisk-commits] pabelanger: branch pabelanger/digiumphones r3075 - /asterisk/team/pabelanger/...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 2 11:09:46 CST 2012


Author: pabelanger
Date: Fri Mar  2 11:09:42 2012
New Revision: 3075

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3075
Log:
Add digiumphone branch support

Modified:
    asterisk/team/pabelanger/digiumphones/lib/python/asterisk/version.py

Modified: asterisk/team/pabelanger/digiumphones/lib/python/asterisk/version.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/digiumphones/lib/python/asterisk/version.py?view=diff&rev=3075&r1=3074&r2=3075
==============================================================================
--- asterisk/team/pabelanger/digiumphones/lib/python/asterisk/version.py (original)
+++ asterisk/team/pabelanger/digiumphones/lib/python/asterisk/version.py Fri Mar  2 11:09:42 2012
@@ -82,7 +82,7 @@
         self.major = None
         self.minor = None
         self.patch = None
-        self.branch = "branch-%s" % self.concept
+        self.branch = self.__parse_version_branch("branch-%s" % self.concept)
         if len(parts) >= 2:
             self.major = parts[1]
         if len(parts) >= 3:
@@ -105,9 +105,13 @@
                 self.version_str
         )
         if match is not None:
-            self.branch = match.group("branch")
+            self.branch = self.__parse_version_branch(match.group("branch"))
             self.revision = match.group("revision")
             self.parent = match.group("parent")
+
+    def __parse_version_branch(self, branch):
+        self.phone = re.search("-digiumphones", branch)
+        return branch.replace("-digiumphones", "")
 
     def __parse_version_patch(self, patch):
         parts = patch.split("-")
@@ -244,6 +248,15 @@
         self.assertEqual(str(v), "SVN-branch-10-r12345")
         self.assertEqual(v.branch, "branch-10")
         self.assertEqual(v.revision, "12345")
+        self.assertFalse(v.phone)
+
+    def test_svn_version6(self):
+        v = AsteriskVersion("SVN-branch-1.8-digiumphones-r357808-/branches/1.8")
+        self.assertTrue(v.svn)
+        self.assertEqual(v.branch, "branch-1.8")
+        self.assertEqual(v.revision, "357808")
+        self.assertEqual(v.parent, "/branches/1.8")
+        self.assertTrue(v.phone)
 
     def test_cmp(self):
         v1 = AsteriskVersion("1.4")




More information about the asterisk-commits mailing list