Permalink
Browse files

memacs_svn: ready to use

Signed-off-by: Armin Wieser <armin.wieser@gmail.com>
  • Loading branch information...
1 parent e55e7a4 commit dce974d959f088a74e3734deadb5511c187901bd @awieser awieser committed Dec 27, 2011
View
47 versioning_systems/memacs_svn.org
@@ -0,0 +1,47 @@
+## Time-stamp: <2011-12-27 14:58:16 armin>
+## This file is best viewed with GNU Emacs Org-mode: http://orgmode.org/
+
+* memacs-svn
+
+** Current status
+
+Done, if you find any errors do not hesitate to contact us.
+
+** Data Source
+
+Version control systems]] are quite common to manage all kind of data
+with. [[http://en.wikipedia.org/wiki/Apache_Subversion][Subversion (SVN)]] is a modern system that is widely used for
+revision control.
+
+This memacs module parses output of:
+: svn log --xml
+
+
+** Example Invocation
+
+*** with pipe from stream
+: cd /path/to/svn-repo/
+: svn log --xml | /path/to/Memacs/memacs_svn.py -f /path/to/svn-xml-file.xml -o /home/user/orgmode/memacs/svn-foo.org_archive
+
+or in one line:
+
+: cd /path/to/svn-repo/ && svn log --xml | /path/to/Memacs/memacs_svn.py -f /path/to/svn-xml-file.xml -o /home/user/orgmode/memacs/svn-foo.org_archive
+
+** from file
+: cd /path/to/svn-repo/
+: svn log --xml > /tmp/svn-log.xml
+: /path/to/Memacs/memacs_svn.py -f /tmp/svn-log.xml -o /home/user/orgmode/memacs/svn-foo.org_archive
+
+or in one line:
+
+: cd /path/to/svn-repo/ && svn log --xml > /tmp/svn-log.xml && /path/to/Memacs/memacs_svn.py -f /tmp/svn-log.xml -o /home/user/orgmode/memacs/svn-foo.org_archive
+
+** Example Orgmode entries
+
+Whenever user "Bob" commits a change set (resulting in revision 42) to
+an example project, memacs_svn can provide an entry like this:
+
+: ** Bob (r42): solved the address field bug :svn:Memacs:
+: :PROPERTIES:
+: :CREATED: <2011-07-23 Sat 16:00>
+: :END:
View
31 versioning_systems/svn/memacs-svn.org
@@ -1,31 +0,0 @@
-## Time-stamp: <2011-09-20 16:05:04 vk>
-## This file is best viewed with GNU Emacs Org-mode: http://orgmode.org/
-
-* memacs-svn
-
-** Current status
-
-work in progress
-
-** Data Source
-
-Version control systems]] are quite common to manage all kind of data
-with. [[http://en.wikipedia.org/wiki/Apache_Subversion][Subversion (SVN)]] is a modern system that is widely used for
-revision control.
-
-** Example Invocation
-
-work in progress
-
-** Example Orgmode entries
-
-Whenever user "Bob" commits a change set (resulting in revision 42) to
-an example project called "myproject", svn-module can provide an entry
-like this:
-
-: ** myproject (Bob) r42: solved the address field bug :svn:Menacs:
-: <2011-07-23 Sat 16:00>
-: :PROPERTIES:
-: :CREATED: <2011-07-23 Sat 16:00>
-: :REVISION: 42
-: :END:
View
94 versioning_systems/tests/memacs_svn_test.py
@@ -0,0 +1,94 @@
+# -*- coding: utf-8 -*-
+# Time-stamp: <2011-10-28 15:13:31 aw>
+
+import unittest
+import sys
+import os
+sys.path.append(
+ os.path.dirname(
+ os.path.dirname(
+ os.path.dirname(
+ os.path.abspath(__file__)))))
+from versioning_systems.memacs_svn import SvnMemacs
+
+
+class TestGitMemacs(unittest.TestCase):
+
+ def setUp(self):
+ test_file = os.path.dirname(os.path.abspath(__file__)) + \
+ os.sep + "svn-log-xml.txt"
+ argv = "-s -f " + test_file
+ memacs = SvnMemacs(argv=argv.split())
+ self.data = memacs.test_get_entries()
+
+ def test_from_file(self):
+ data = self.data
+
+ # generate assertEquals :)
+ #for d in range(len(data)):
+ # print "self.assertEqual(\n\tdata[%d],\n\t \"%s\")" % \
+ # (d, data[d])
+
+ self.assertEqual(
+ data[0],
+ "** group-5 (r5): finished ?")
+ self.assertEqual(
+ data[1],
+ " :PROPERTIES:")
+ self.assertEqual(
+ data[2],
+ " :CREATED: <2011-10-27 Thu 19:50:16>")
+ self.assertEqual(
+ data[3],
+ " :END:")
+ self.assertEqual(
+ data[4],
+ "** group-5 (r4): finished 5,")
+ self.assertEqual(
+ data[5],
+ " added package to assignment1.tex for landscaping (see 5.tex)")
+ self.assertEqual(
+ data[6],
+ " :PROPERTIES:")
+ self.assertEqual(
+ data[7],
+ " :CREATED: <2011-10-27 Thu 19:18:26>")
+ self.assertEqual(
+ data[8],
+ " :END:")
+ self.assertEqual(
+ data[9],
+ "** group-5 (r3): 5b.")
+ self.assertEqual(
+ data[10],
+ " :PROPERTIES:")
+ self.assertEqual(
+ data[11],
+ " :CREATED: <2011-10-27 Thu 17:38:17>")
+ self.assertEqual(
+ data[12],
+ " :END:")
+ self.assertEqual(
+ data[13],
+ "** group-5 (r2): 5.tex")
+ self.assertEqual(
+ data[14],
+ " :PROPERTIES:")
+ self.assertEqual(
+ data[15],
+ " :CREATED: <2011-10-27 Thu 16:41:11>")
+ self.assertEqual(
+ data[16],
+ " :END:")
+ self.assertEqual(
+ data[17],
+ "** group-5 (r1): initial files")
+ self.assertEqual(
+ data[18],
+ " :PROPERTIES:")
+ self.assertEqual(
+ data[19],
+ " :CREATED: <2011-10-27 Thu 10:44:55>")
+ self.assertEqual(
+ data[20],
+ " :END:")
View
39 versioning_systems/tests/svn-log-xml.txt
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<log>
+<logentry
+ revision="5">
+<author>group-5</author>
+<date>2011-10-27T17:50:16.271032Z</date>
+<msg>finished ?
+</msg>
+</logentry>
+<logentry
+ revision="4">
+<author>group-5</author>
+<date>2011-10-27T17:18:26.847990Z</date>
+<msg>finished 5,
+
+added package to assignment1.tex for landscaping (see 5.tex)
+</msg>
+</logentry>
+<logentry
+ revision="3">
+<author>group-5</author>
+<date>2011-10-27T15:38:17.064352Z</date>
+<msg>5b.</msg>
+</logentry>
+<logentry
+ revision="2">
+<author>group-5</author>
+<date>2011-10-27T14:41:11.677430Z</date>
+<msg>5.tex
+</msg>
+</logentry>
+<logentry
+ revision="1">
+<author>group-5</author>
+<date>2011-10-27T08:44:55.750206Z</date>
+<msg>initial files
+</msg>
+</logentry>
+</log>

0 comments on commit dce974d

Please sign in to comment.