Rev 177: Initial work on merge details in emails by mthaddon. in http://bzr.daniel-watkins.co.uk/pqm/merge-details

Daniel Watkins daniel at daniel-watkins.co.uk
Mon Jul 14 16:20:20 BST 2008


At http://bzr.daniel-watkins.co.uk/pqm/merge-details

------------------------------------------------------------
revno: 177
revision-id: daniel at daniel-watkins.co.uk-20080714151901-zj954rveplghgtpn
parent: robertc at robertcollins.net-20080710074340-dl0w25nbutl88sz2
author: Tom Haddon <tom.haddon at canonical.com>
committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
branch nick: merge-details
timestamp: Mon 2008-07-14 16:19:01 +0100
message:
  Initial work on merge details in emails by mthaddon.
-------------- next part --------------
=== modified file 'pqm/__init__.py'
--- a/pqm/__init__.py	2007-11-29 21:40:54 +0000
+++ b/pqm/__init__.py	2008-07-14 15:19:01 +0000
@@ -545,6 +545,20 @@
         self.successful.append(line)
         self.output += ['\n', '%s succeeded at %s' % (merge_name, time.strftime('%c')), '\n']
         self.get_vcs().commit(sender, dir, self.commitmsg, to_repo_revision, config)
+        # Now that we've committed to the branch, let's include the 
+        # commit details in the output
+        try:
+            revno, commit_msg = self.get_vcs().latest_revision_info(to_repo_revision)
+            self.successful[-1] = ("%s\n" 
+                            "Revision: %s \n"
+                            "Commit Message: %s" 
+                            % (line, revno, commit_msg))
+            self.output += ["\n", "Revision Details:", "\n", 
+                "Revision: %s" % revno, "\n", 
+                "Commit Message: %s" % commit_msg, "\n"]
+        except PQMTlaFailure:
+            # If the latest_revision_info function isn't implemented
+            pass
 
     def get_arch_impl(self):
         if self.arch_impl is None:
@@ -1223,6 +1237,9 @@
     def make_local_dir(self, sender, branch, output_dir):
         raise PQMTlaFailure(sender, 'Unsupported operation')
 
+    def latest_revision_info(self, sender, branch):
+        raise PQMTlaFailure(sender, 'Unsupported operation')
+
 
 class ArchHandler(VCSHandler):
      
@@ -1455,6 +1472,11 @@
         branch = Branch.open(branch_spec)
         branch.create_checkout(output_dir, lightweight=True)
 
+    def latest_revision_info(self, branch_location):
+        from bzrlib.branch import Branch
+        branch = Branch.open(branch_location)
+        return branch.revno(), branch.repository.get_revision(branch.last_revision()).message
+
 
 class BranchSpecOptionHandler:
     """Configuration mechanism for a branch specifications.



More information about the bazaar-commits mailing list