[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#837076: marked as done (svnmailer: [PATCH] pretty-print svn:mergeinfo diffs)



Your message dated Thu, 15 Sep 2016 17:57:56 +0000
with message-id <E1bkav6-0003c1-Aq@franck.debian.org>
and subject line Bug#837076: fixed in svnmailer 1.0.9-3
has caused the Debian Bug report #837076,
regarding svnmailer: [PATCH] pretty-print svn:mergeinfo diffs
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
837076: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=837076
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: svnmailer
Version: 1.0.9-2
Severity: wishlist
Tags: upstream patch
Control: forwarded -1 svnmailer-bugs@perlig.de

Dear Maintainer,

Please find attached a patch to pretty-print svn:mergeinfo diffs.  

The patch changes the way svn:mergeinfo diffs are rendered, replacing
the unidiff (which is often unreadable) by a human-oriented output which
states just the operative change done.  Here are before/after examples:

before: https://mail-archives.apache.org/mod_mbox/subversion-commits/201104.mbox/%3C20110427152444.58BF42388901@eris.apache.org%3E
after:  https://mail-archives.apache.org/mod_mbox/subversion-commits/201311.mbox/%3C20131102040252.DAC7E2388B43@eris.apache.org%3E

The 'svn' cmdline tool uses the same output format; for example:
«svn diff -c r1538140 https://svn.apache.org/repos/asf/subversion/branches/1.7.x --depth=empty».

The patch is against the most recent upstream snapshot, 1.1.0-dev-r1373.

Cheers,

Daniel

P.S. I'm setting the 'forwarded' tag since I submitted this upstream
in 2012.
diff -ru svnmailer-1.1.0-dev-r1373/src/lib/svnmailer/notifier/_base.py svnmailer-1.1.0-dev-r1373-svnmergeinfo-diffs/src/lib/svnmailer/notifier/_base.py
--- svnmailer-1.1.0-dev-r1373/src/lib/svnmailer/notifier/_base.py	2005-09-25 14:51:23.000000000 +0000
+++ svnmailer-1.1.0-dev-r1373-svnmergeinfo-diffs/src/lib/svnmailer/notifier/_base.py	2012-03-04 09:02:37.672298840 +0000
@@ -555,6 +555,42 @@
         return subversion.isUnicodeProperty(name)
 
 
+    def isNonUnidiffProperty(self, name):
+        """ Returns if the supplied property name is diff'd not in unidiff
+
+            :param `name`: The property name
+            :type `name`: ``str``
+
+            :param `name`: The property name
+            :type `name`: ``str``
+
+            :return: The decision
+            :rtype: ``bool``
+        """
+        from svnmailer import subversion
+        return subversion.isNonUnidiffProperty(name)
+
+    def diffNonUnidiffProperty(self, fp, name, value1, value2):
+        """ Write a diff of a non-unudiff property.
+
+            :param `fp`: File-like object to write to
+            :type `name`: ``file``
+
+            :param `name`: The property name
+            :type `name`: ``str``
+
+            :param `value1`: old value
+            :type `value1`: ``str``
+
+            :param `value2`: new value
+            :type `value2`: ``str``
+
+            :return: None
+            :rtype: ``NoneType``
+        """
+        from svnmailer import subversion
+        return subversion.diffNonUnidiffProperty(fp, name, value1, value2)
+
     def isBinaryProperty(self, values):
         """ Returns if the supplied property seems to be binary
 
diff -ru svnmailer-1.1.0-dev-r1373/src/lib/svnmailer/notifier/_text.py svnmailer-1.1.0-dev-r1373-svnmergeinfo-diffs/src/lib/svnmailer/notifier/_text.py
--- svnmailer-1.1.0-dev-r1373/src/lib/svnmailer/notifier/_text.py	2005-09-24 18:17:24.000000000 +0000
+++ svnmailer-1.1.0-dev-r1373-svnmergeinfo-diffs/src/lib/svnmailer/notifier/_text.py	2012-03-04 09:23:09.142297493 +0000
@@ -265,6 +265,9 @@
         elif token == self.ADD and self.isOneLineProperty(name, value2):
             self.fp.write("    %s = %s\n" % (name, value2))
 
+        elif token == self.MODIFY and self.isNonUnidiffProperty(name):
+            self.diffNonUnidiffProperty(self.fp, name, value1, value2)
+
         else:
             # avoid "no newline at end of file" for props
             if value1 and not value1.endswith("\n"):
diff -ru svnmailer-1.1.0-dev-r1373/src/lib/svnmailer/subversion.py svnmailer-1.1.0-dev-r1373-svnmergeinfo-diffs/src/lib/svnmailer/subversion.py
--- svnmailer-1.1.0-dev-r1373/src/lib/svnmailer/subversion.py	2005-09-25 07:29:22.000000000 +0000
+++ svnmailer-1.1.0-dev-r1373-svnmergeinfo-diffs/src/lib/svnmailer/subversion.py	2012-03-04 09:25:56.734796255 +0000
@@ -31,6 +31,7 @@
 __all__       = [
     'version', 'Repository', 'Error', 'RepositoryError', 'isUnicodeProperty'
     'VersionedPathDescriptor', 'LockedPathDescriptor',
+    'isNonUnidiffProperty', 'diffNonUnidiffProperty',
 ]
 
 
@@ -105,6 +106,46 @@
     return bool(svn_core.svn_prop_needs_translation(name))
 
 
+def isNonUnidiffProperty(name):
+    """ Returns if the supplied name is not to be unidiff'd
+
+        :param name: The property name
+        :type name: ``str``
+
+        :return: The decision
+        :rtype: ``bool``
+    """
+    return name == svn_core.SVN_PROP_MERGEINFO
+
+def diffNonUnidiffProperty(fp, name, value1, value2):
+    """ Write a diff of a non-unudiff property.
+
+        :param `fp`: File-like object to write to
+        :type `name`: ``file``
+
+        :param `name`: The property name
+        :type `name`: ``str``
+
+        :param `value1`: old value
+        :type `value1`: ``str``
+
+        :param `value2`: new value
+        :type `value2`: ``str``
+
+        :return: None
+        :rtype: ``NoneType``
+    """
+    # TODO: throw some error if this isn't svn:mergeinfo
+    # This mirrors display_mergeinfo_diff() in libsvn_client/diff.c
+    parsed1 = svn_core.svn_mergeinfo_parse(value1)
+    parsed2 = svn_core.svn_mergeinfo_parse(value2)
+    deleted, added = svn_core.svn_mergeinfo_diff(parsed1, parsed2, True)
+    for mergeinfo, text in [(deleted, "Reverse-merged"), 
+                            (added, "Merged")]:
+        for fspath, rangelist in mergeinfo.iteritems():
+            rangelist_str = svn_core.svn_rangelist_to_string(rangelist)
+            fp.write("  %s %s:r%s\n" % (text, fspath, rangelist_str))
+
 def isBinary(mtype):
     """ Returns True if the supplied mime type represents a binary
 

--- End Message ---
--- Begin Message ---
Source: svnmailer
Source-Version: 1.0.9-3

We believe that the bug you reported is fixed in the latest version of
svnmailer, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 837076@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Shahaf <danielsh@apache.org> (supplier of updated svnmailer package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 15 Sep 2016 14:18:21 +0000
Source: svnmailer
Binary: svnmailer
Architecture: source
Version: 1.0.9-3
Distribution: unstable
Urgency: medium
Maintainer: Debian QA Group <packages@qa.debian.org>
Changed-By: Daniel Shahaf <danielsh@apache.org>
Description:
 svnmailer  - extensible Subversion commit notification tool
Closes: 837076
Changes:
 svnmailer (1.0.9-3) unstable; urgency=medium
 .
   * QA upload.
   * Package changes:
     + new patch: Pretty-print svn:mergeinfo diffs.  (Closes: #837076)
     + svnmailer.conf example: Pass -oi to sendmail to disable \n.\n ending an
       email prematurely with some MTA's.
   * Packaging changes:
     + Move Vcs-* to collab-maint, the package has been orphaned so it's not
       longer part of the Python Applications Packaging Team.
     + Bump Standards-Version to 3.9.8 (no changes).
Checksums-Sha1:
 836fd4882f36a99d9061079149a0c4b15034badf 1868 svnmailer_1.0.9-3.dsc
 2694df40a0c069378c2e21d10e20da181f89596d 5884 svnmailer_1.0.9-3.debian.tar.xz
Checksums-Sha256:
 1ec88245d2a965bbd7e11af5a7849e8cbcf8279b3c0f8a1e451d051f0beb9863 1868 svnmailer_1.0.9-3.dsc
 6fec5fc524bb94cf9ace9bdb83a540481cb7a59a99eef8bd2094683f1a670ee8 5884 svnmailer_1.0.9-3.debian.tar.xz
Files:
 356b9c4ffe48f4b4dba2bcc72936af17 1868 vcs optional svnmailer_1.0.9-3.dsc
 e8a2f2ee4c2029877ad479d292afd4bb 5884 vcs optional svnmailer_1.0.9-3.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJX2q8wAAoJEEsEP825REVAndIQAJzunuP3kIFVybs8fb+Wsv98
cuEKxZ/pAOmzYS8U/8u3zr8Zr2Jg4U9UEUTOPV43n70CuYpCZYJxRd2kULWe5O3d
PK4rsGxnQxiQSpNrK/C6/5Q2JBe+ASQR4p5RHkBaBst0qom4XhgQ7AdjAZHtadDo
2/x99ofs9JRefhuoPYo9KNUx8hRjH9qWuhwgz4G2ZSBNZnKPhBAq1ffIXnO/BmGh
1TvTNZs0nl9Rk4502H5btzHwudWAj9O7VmZl2I36bvupf8qHdSkPzJu4Es1ooxaM
um4k7Lqk26rzEdtdwG2IkEIyjPG1/q5p5hmu2Udwdluh2dPRT2hdYy62oPt1EI46
1TP1DXPAWa6ID7H+65H3d2ZSRxhA2GW8pR5GcHoRRedEsxQ7G2e0AYcBuQCU0EMH
zByP4QBM1Jlus11ljn9RUI9RkmYYJF/0X9zamcXKphgy6ITJUGa1cR18wdYJRIA7
Vt2Vazh/yYmvrgcBB5Yt+3e7hzwASOoTQq1KfYz2AEX5csWZFGZ/+qWctqT+8MW5
GDvuogVp+Sc19wd1m5aIYh5sv6vXB5NiWFeKbmg1Yj/48KbyViMUqbFbNJCHjZvX
nR4vfdo13mUtRTNh02kqnURP7tpyEaoxUsbj3bv8uWttGuO5rZm4wo3vkmrt0ioj
RFFqAv2fYfbNcjmuM7Yr
=/4oM
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: