Rev 181: Merged pqm.dev. in http://bzr.daniel-watkins.co.uk/pqm/queue-abstraction-2

Daniel Watkins daniel at daniel-watkins.co.uk
Tue Aug 5 07:40:12 BST 2008


At http://bzr.daniel-watkins.co.uk/pqm/queue-abstraction-2

------------------------------------------------------------
revno: 181
revision-id: daniel at daniel-watkins.co.uk-20080805063829-36q57530d1s0knf1
parent: tim.penhey at canonical.com-20080717071731-w9qz2wov7q8zgmbt
parent: robertc at robertcollins.net-20080717100934-40fjde09nglggsub
committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
branch nick: queue-abstraction-2
timestamp: Tue 2008-08-05 07:38:29 +0100
message:
  Merged pqm.dev.
modified:
  pqm/__init__.py                i_dc99ede3-0c64-434d-ac84-305c06455a8d
  pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
  pqm/ui/tests/test_twisted.py   x_Robert_Collins_<robert.collins at canonical.com>_Sat_Jul__9_22:36:13_2005_7873.0
    ------------------------------------------------------------
    revno: 174.4.8
    revision-id: robertc at robertcollins.net-20080717100934-40fjde09nglggsub
    parent: robertc at robertcollins.net-20080717095436-x0i84kjw685r8o3m
    parent: tim.penhey at canonical.com-20080717024519-8a5oqewh8f1gzkjl
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: public
    timestamp: Thu 2008-07-17 20:09:34 +1000
    message:
      Merge Tim's queue-abstraction step one patch.
    added:
      pqm/errors.py                  errors.py-20080528044209-lpacj0a0ub4woseh-1
      pqm/script.py                  script.py-20080528044209-lpacj0a0ub4woseh-2
    modified:
      bin/pqm                        i_Simple_patch_queue_manager_for_tla
      pqm/__init__.py                i_dc99ede3-0c64-434d-ac84-305c06455a8d
      pqm/tests/test_lockfile.py     test_lockfile.py-20060111035725-07e8b573302c8fef
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
    ------------------------------------------------------------
    revno: 174.4.7
    revision-id: robertc at robertcollins.net-20080717095436-x0i84kjw685r8o3m
    parent: robertc at robertcollins.net-20080716160150-guftqlv1sp1bfju4
    parent: daniel at daniel-watkins.co.uk-20080716154448-obqwpqcaqexiveya
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: public
    timestamp: Thu 2008-07-17 19:54:36 +1000
    message:
      Merge test string fixes - moving from arch names to url's.
    modified:
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
      pqm/ui/tests/test_twisted.py   x_Robert_Collins_<robert.collins at canonical.com>_Sat_Jul__9_22:36:13_2005_7873.0
    ------------------------------------------------------------
    revno: 174.7.8
    revision-id: daniel at daniel-watkins.co.uk-20080716154448-obqwpqcaqexiveya
    parent: d.m.watkins at warwick.ac.uk-20080703003757-nntkfazhmvysgvfg
    parent: robertc at robertcollins.net-20080716131953-s4fp83isqf3fpazo
    committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
    branch nick: rename-test-strings
    timestamp: Wed 2008-07-16 16:44:48 +0100
    message:
      Merged pqm.dev.  There were epic conflicts.
    added:
      pqm/commandline.py             commandline.py-20080416102158-op31dy0lnkeo91ww-1
      pqm/tests/test_commandline.py  test_commandline.py-20080416102209-p18w8m9sw21704j9-1
    modified:
      .bzrignore                     bzrignore-20060322120158-35e5bcdaf76b6fdf
      bin/pqm                        i_Simple_patch_queue_manager_for_tla
      pqm/__init__.py                i_dc99ede3-0c64-434d-ac84-305c06455a8d
      pqm/tests/test_lockfile.py     test_lockfile.py-20060111035725-07e8b573302c8fef
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
      pqm/ui/tests/test_twisted.py   x_Robert_Collins_<robert.collins at canonical.com>_Sat_Jul__9_22:36:13_2005_7873.0
      pqm/ui/twistd.py               x_Robert_Collins_<robert.collins at canonical.com>_Sun_Jul_10_02:00:08_2005_15556.0
    ------------------------------------------------------------
    revno: 174.7.7
    revision-id: d.m.watkins at warwick.ac.uk-20080703003757-nntkfazhmvysgvfg
    parent: d.m.watkins at warwick.ac.uk-20080703003519-qri5xlw0d9uxvqii
    committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
    branch nick: rename-test-strings
    timestamp: Thu 2008-07-03 01:37:57 +0100
    message:
      Removed all instances of old-style naming conventions.
    modified:
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
    ------------------------------------------------------------
    revno: 174.7.6
    revision-id: d.m.watkins at warwick.ac.uk-20080703003519-qri5xlw0d9uxvqii
    parent: d.m.watkins at warwick.ac.uk-20080702035420-fcxxpholfeidfj5n
    committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
    branch nick: rename-test-strings
    timestamp: Thu 2008-07-03 01:35:19 +0100
    message:
      Removed now unnecessary test for old-style naming conventions.
    modified:
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
    ------------------------------------------------------------
    revno: 174.7.5
    revision-id: d.m.watkins at warwick.ac.uk-20080702035420-fcxxpholfeidfj5n
    parent: d.m.watkins at warwick.ac.uk-20080702034253-8nptmciqfcdc9yxg
    committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
    branch nick: remove-vcs-abstraction
    timestamp: Wed 2008-07-02 04:54:20 +0100
    message:
      Marked remaining used of arch naming convention.
    modified:
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
    ------------------------------------------------------------
    revno: 174.7.4
    revision-id: d.m.watkins at warwick.ac.uk-20080702034253-8nptmciqfcdc9yxg
    parent: d.m.watkins at warwick.ac.uk-20080702034011-cfdndy1bfq59wk2c
    committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
    branch nick: remove-vcs-abstraction
    timestamp: Wed 2008-07-02 04:42:53 +0100
    message:
      Rewrapped long lines.
    modified:
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
    ------------------------------------------------------------
    revno: 174.7.3
    revision-id: d.m.watkins at warwick.ac.uk-20080702034011-cfdndy1bfq59wk2c
    parent: d.m.watkins at warwick.ac.uk-20080702033213-exyr79o8aywd28a1
    committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
    branch nick: remove-vcs-abstraction
    timestamp: Wed 2008-07-02 04:40:11 +0100
    message:
      Changed from paths to URLs.
    modified:
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
      pqm/ui/tests/test_twisted.py   x_Robert_Collins_<robert.collins at canonical.com>_Sat_Jul__9_22:36:13_2005_7873.0
    ------------------------------------------------------------
    revno: 174.7.2
    revision-id: d.m.watkins at warwick.ac.uk-20080702033213-exyr79o8aywd28a1
    parent: d.m.watkins at warwick.ac.uk-20080702025023-vvdrwf215nundsad
    committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
    branch nick: remove-vcs-abstraction
    timestamp: Wed 2008-07-02 04:32:13 +0100
    message:
      Started replacement in tests.
    modified:
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
      pqm/ui/tests/test_twisted.py   x_Robert_Collins_<robert.collins at canonical.com>_Sat_Jul__9_22:36:13_2005_7873.0
    ------------------------------------------------------------
    revno: 174.7.1
    revision-id: d.m.watkins at warwick.ac.uk-20080702025023-vvdrwf215nundsad
    parent: robertc at robertcollins.net-20080415014518-qugji1mpm5g11gir
    parent: d.m.watkins at warwick.ac.uk-20080702013313-tpow1un410t1ihlr
    committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
    branch nick: remove-vcs-abstraction
    timestamp: Wed 2008-07-02 03:50:23 +0100
    message:
      Merged test fixes.
    modified:
      pqm/tests/test_pqm.py          x_Robert_Collins_<robert.collins at canonical.com>_Thu_Aug__4_22:52:41_2005_804.0
-------------- next part --------------
=== modified file 'pqm/__init__.py'
--- a/pqm/__init__.py	2008-07-17 07:17:31 +0000
+++ b/pqm/__init__.py	2008-08-05 06:38:29 +0000
@@ -19,7 +19,6 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 from copy import copy
-from datetime import datetime
 import errno
 import logging
 import os

=== modified file 'pqm/tests/test_pqm.py'
--- a/pqm/tests/test_pqm.py	2008-07-17 07:17:31 +0000
+++ b/pqm/tests/test_pqm.py	2008-08-05 06:38:29 +0000
@@ -18,28 +18,25 @@
 sample_message = dedent("""\
     From: John.Citizen at example.com
     Subject: A new action
-    star-merge archive at example.com/foo--bar--0 archive2 at example.com/bar--foo--1
+    star-merge http://www.example.com/foo/bar http://www.example.com/bar/baz
     """)
-
 sample_message_2 = dedent("""\
     From: John.Citizen at example.com
     Subject: A new action
-    star-merge archive at example.com/foo--bar--0 archive2 at example.com/bar--foo--2
+    star-merge http://www.example.com/qux/thud http://www.example.com/fred/waldo
     """)
-
 sample_message_bad = dedent("""\
     From: John.Citizen at example.com
     Subject: A new action
-    star-merge archive at example.com/foo--bar--0  unregistered at example.com/bar--foo--1
+    star-merge http://www.example.com/foo/bar http://www.example.com/foo/unregistered
     """)
-
 sample_signed_message = dedent("""\
     From: whee at bar.com (Matthew Thomas)
     Subject: [trivial] fix various actions portlet icons
     -----BEGIN PGP SIGNED MESSAGE-----
     Hash: SHA1
 
-    star-merge mpt at canonical.com/launchpad--devel--0 rocketfuel at canonical.com/launchpad--devel--0
+    star-merge http://www.example.com/argh/blah http://www.example.com/bing/bong
     -----BEGIN PGP SIGNATURE-----
     Version: GnuPG v1.2.5 (GNU/Linux)
 
@@ -90,13 +87,13 @@
 sample_config_unpublished = dedent("""\
     [DEFAULT]
     queuedir=/tmp
-    [foo at bar/gam--foo--0]
+    [http://www.example.com/bar/baz]
     """)
 
 sample_config_published = dedent("""\
     [DEFAULT]
     queuedir=/tmp
-    [foo at bar/gam--foo--0]
+    [http://www.example.com/bar/baz]
     published_at=file:///a
     [file:///tmp/foo]
     published_at=file:///b
@@ -135,10 +132,10 @@
         myFile.write(dedent("""\
             [DEFAULT]
             queuedir=%s/queue
-            [archive2 at example.com/bar--foo--1]
+            [http://www.example.com/bar/baz]
             project=project
-            [archive2 at example.com/bar--foo--2]
-            """ % self.cwd))
+            [http://www.example.com/fred/waldo]
+            """) % self.cwd)
         myFile.close()
         self.queuedir = os.path.join(self.cwd, "queue")
         try:
@@ -200,16 +197,16 @@
         self.assertEqual(script.getSender(), "John.Citizen at example.com")
         self.assertEqual(script.getSubject(), "A new action")
         self.assertEqual(script.getContent(),
-            ("star-merge archive at example.com/foo--bar--0 "
-             "archive2 at example.com/bar--foo--1\n"))
+            ("star-merge http://www.example.com/foo/bar "
+             "http://www.example.com/bar/baz\n"))
         self.assertEqual(script.getLines(),
-            [("star-merge archive at example.com/foo--bar--0 "
-             "archive2 at example.com/bar--foo--1")])
-        self.assertEqual([MergeCommand(None,
-                                       None,
-                                       None,
-                                       'archive at example.com/foo--bar--0',
-                                       'archive2 at example.com/bar--foo--1')],
+            [("star-merge http://www.example.com/foo/bar "
+              "http://www.example.com/bar/baz")])
+        self.assertEqual([pqm.MergeCommand(None,
+                                           None,
+                                           None,
+                                           'http://www.example.com/foo/bar',
+                                           'http://www.example.com/bar/baz')],
                          script.getCommands())
 
     def testGPGFields(self):
@@ -221,7 +218,7 @@
             -----BEGIN PGP SIGNED MESSAGE-----
             Hash: SHA1
 
-            star-merge mpt at canonical.com/launchpad--devel--0 rocketfuel at canonical.com/launchpad--devel--0
+            star-merge http://www.example.com/argh/blah http://www.example.com/bing/bong
             -----BEGIN PGP SIGNATURE-----
             Version: GnuPG v1.2.5 (GNU/Linux)
 
@@ -230,15 +227,15 @@
             =X7Ib
             -----END PGP SIGNATURE-----
             """))
-        self.assertEqual(script.getLines(),
-            [("star-merge mpt at canonical.com/launchpad--devel--0 "
-             "rocketfuel at canonical.com/launchpad--devel--0")])
+        self.assertEqual(script.getLines(), 
+            [("star-merge http://www.example.com/argh/blah "
+              "http://www.example.com/bing/bong")])
         self.assertEqual(
-            [MergeCommand(None,
-                          None,
-                          None,
-                          'mpt at canonical.com/launchpad--devel--0',
-                          'rocketfuel at canonical.com/launchpad--devel--0')],
+            [pqm.MergeCommand(None,
+                              None,
+                              None,
+                              'http://www.example.com/argh/blah',
+                              'http://www.example.com/bing/bong')],
             script.getCommands())
 
     def testDate(self):
@@ -307,11 +304,6 @@
         self.assertEqual(star_match.group(1), 'file:///url1')
         self.assertEqual(star_match.group(2), 'file:///url2')
 
-    def test_star_merge_names(self):
-        star_match = EmailScript.star_re.match("star-merge foo at bar/foo--bar--0 foo at bar/gam--foo--0")
-        self.assertEqual(star_match.group(1), 'foo at bar/foo--bar--0')
-        self.assertEqual(star_match.group(2), 'foo at bar/gam--foo--0')
-
     def test_get_arch_impl(self):
         configp = ConfigParser()
         handler = pqm.BranchSpecOptionHandler(configp)
@@ -324,12 +316,10 @@
     def test_check_revision(self):
         configp = ConfigParser()
         handler = pqm.BranchSpecOptionHandler(configp)
-        handler._specs = {'foo at bar/gam--foo--0':{},
-                          'file:///tmp/foo':{},
+        handler._specs = {'file:///tmp/foo':{},
                           'file:///tmp/bar/':{}}
         runner = CommandRunner(None, handler, configp, [])
         runner.script = MockScript()
-        runner.check_target('foo at bar/gam--foo--0', 'blah')
         runner.check_target('file:///tmp/foo', 'blah')
         self.assertRaises(PQMCmdFailure,
                           runner.check_target,
@@ -345,8 +335,6 @@
         configp = ConfigParser()
         handler = pqm.BranchSpecOptionHandler(configp)
         runner = CommandRunner(None, handler, configp, [])
-        self.assertEqual(runner._make_wd_path('/foo', 'foo at bar/gam--foo--0'),
-                         '/foo/foo at bar')
         self.assertEqual(runner._make_wd_path('/foo', '/foo/bar'), '/foo/foo')
         self.assertEqual(runner._make_wd_path('/foo', 'file:///foo/bar'),
                          '/foo/file')
@@ -357,8 +345,6 @@
         pqm.pqm_subdir = '/tmp' # ewww
         handler = pqm.BranchSpecOptionHandler(configp)
         runner = CommandRunner(None, handler, configp, [])
-        self.assertEqual(runner._branch_name('foo at bar/gam--foo--0'),
-                         'gam--foo--0')
         self.assertEqual(runner._branch_name('foo'), 'foo')
         self.assertEqual(runner._branch_name('file:///home/bar/foo'), 'foo')
         self.assertEqual(runner._branch_name('file:///home/bar/foo'), 'foo')
@@ -654,23 +640,24 @@
         configp.readfp(StringIO(sample_config_unpublished))
         pqm.pqm_subdir = '/tmp' # ewww
         handler = pqm.BranchSpecOptionHandler(configp)
-        branch, config = handler.get_target_config('foo at bar/gam--foo--0')
-        self.assertEqual('foo at bar/gam--foo--0', branch)
+        branch, config = handler.get_target_config('http://www.example.com/bar/baz')
+        self.assertEqual('http://www.example.com/bar/baz', branch)
         self.assertEqual(None, config['published_at'])
         self.assertEqual(None, config['publish_to'])
-        self.assertRaises(KeyError, handler.get_target_config, 'foo at bar/gam--0')
+        self.assertRaises(KeyError, handler.get_target_config, 'baz/baz')
 
     def test_get_target_config(self):
         configp = ConfigParser()
         configp.readfp(StringIO(sample_config_published))
         pqm.pqm_subdir = '/tmp' # ewww
         handler = pqm.BranchSpecOptionHandler(configp)
-        branch, config = handler.get_target_config('foo at bar/gam--foo--0')
-        self.assertEqual('foo at bar/gam--foo--0', branch)
+        branch, config = handler.get_target_config(
+                                            'http://www.example.com/bar/baz')
+        self.assertEqual('http://www.example.com/bar/baz', branch)
         self.assertEqual('file:///a', config['published_at'])
         self.assertEqual('file:///a', config['publish_to'])
         # close but shouldn't match:
-        self.assertRaises(KeyError, handler.get_target_config, 'foo at bar/gam--0')
+        self.assertRaises(KeyError, handler.get_target_config, 'bar/bar')
         self.assertRaises(KeyError, handler.get_target_config, 'file:///a/bar')
         # note that publish_to is not overriden by the default from published_at.
         branch, config = handler.get_target_config('file:///tmp/foo')

=== modified file 'pqm/ui/tests/test_twisted.py'
--- a/pqm/ui/tests/test_twisted.py	2008-05-29 02:44:29 +0000
+++ b/pqm/ui/tests/test_twisted.py	2008-08-05 06:38:29 +0000
@@ -87,7 +87,7 @@
 "<ol>"
 "<li><p>...: John.Citizen at example.com, Request for non-PQM managed branch.</p></li>"
 "<li><p>...: John.Citizen at example.com, 'A new action' "
-"<ol><li>Merge archive at example.com/foo--bar--0 archive2 at example.com/bar--foo--2</li></ol></p></li>"
+"<ol><li>Merge http://www.example.com/qux/thud http://www.example.com/fred/waldo</li></ol></p></li>"
 "</ol>")
         self.assertDocTest(expected, html)
 
@@ -119,7 +119,7 @@
 "</pre>"
 "<ul>"
 "<li><p>...: John.Citizen at example.com, 'A new action' "
-"<ol><li>Merge archive at example.com/foo--bar--0 archive2 at example.com/bar--foo--1</li></ol></p></li>"
+"<ol><li>Merge http://www.example.com/foo/bar http://www.example.com/bar/baz</li></ol></p></li>"
 "</ul>"
 "<h2>Coming up</h2>"
 "<ol>"



More information about the bazaar-commits mailing list