incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [1/3] git commit: [#6125] Change format of commit email subject line
Date Thu, 23 May 2013 19:54:40 GMT
Updated Branches:
  refs/heads/master 53d8b05c2 -> e409b0ee5


[#6125] Change format of commit email subject line

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/e409b0ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/e409b0ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/e409b0ee

Branch: refs/heads/master
Commit: e409b0ee51523fe52e819af10408933aa96fd033
Parents: 22cb1a0
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Thu May 23 19:43:36 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Thu May 23 19:46:06 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo_refresh.py              |   13 ++++---------
 ForgeGit/forgegit/tests/model/test_repository.py |    2 +-
 ForgeSVN/forgesvn/tests/model/test_repository.py |    2 +-
 3 files changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e409b0ee/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index 823e09f..e2821f6 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -420,18 +420,13 @@ def send_notifications(repo, commit_ids):
                 len(commit_msgs), repo.app.project.name, repo.app.config.options.mount_label)
             text='\n\n'.join(commit_msgs)
         else:
-            if c.app.tool_label.lower() == 'svn':
-                revision_id = c.app.repo._impl._revno(ci._id)
-            else:
-                revision_id = ci._id
-            subject = '%s committed revision %s: %s' % (
+            subject = '{0} - {1} committed: {2}'.format(
+                repo.shorthand_for_commit(ci._id),
                 ci.authored.name,
-                revision_id,
                 summary)
             branches = repo.symbolics_for_commit(ci)[0]
-            text_branches = ''
-            if branches:
-                text_branches = '%s: ' % ",".join(b for b in branches)
+            text_branches = ('%s: ' % ",".join(b for b in branches)
+                    if branches else '')
             text = "%s%s %s%s" % (text_branches,
                                ci.message,
                                base_url, ci.url())

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e409b0ee/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 150b6e2..2eb90da 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -264,7 +264,7 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
         ThreadLocalORMSession.flush_all()
         notifications = M.Notification.query.find().sort('pubdate')
         n = notifications.all()[2]
-        assert_equal(n.subject, '[test:src-git] Rick Copeland committed revision 1e146e67985dcd71c74de79613719bef7bddca4a:
Change README')
+        assert_equal(n.subject, '[test:src-git] [1e146e] - Rick Copeland committed: Change
README')
         assert 'master,zz: ' in n.text
         send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a'])
         ThreadLocalORMSession.flush_all()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e409b0ee/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 3ff7127..082d423 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -419,7 +419,7 @@ class TestSVNRev(unittest.TestCase):
         ThreadLocalORMSession.flush_all()
         notifications = M.Notification.query.find().sort('pubdate')
         n = notifications.all()[3]
-        assert_equal(n.subject, '[test:src] rick446 committed revision 1: Create readme')
+        assert_equal(n.subject, '[test:src] [r1] - rick446 committed: Create readme')
         assert_equal(n.text, 'Create readme http://localhost//p/test/src/1/')
 
 


Mime
View raw message