diff -Nru icdiff-1.9.3/ChangeLog icdiff-1.9.4/ChangeLog --- icdiff-1.9.3/ChangeLog 2018-08-09 12:51:07.000000000 +0000 +++ icdiff-1.9.4/ChangeLog 2018-10-17 16:12:06.000000000 +0000 @@ -1,3 +1,7 @@ +1.9.4 + Allow {path} and {basename} in --label #139 + Properly implement git difftool protocol #140 + 1.9.3 Properly set the version number diff -Nru icdiff-1.9.3/debian/changelog icdiff-1.9.4/debian/changelog --- icdiff-1.9.3/debian/changelog 2018-08-18 10:07:49.000000000 +0000 +++ icdiff-1.9.4/debian/changelog 2018-10-18 08:35:44.000000000 +0000 @@ -1,3 +1,11 @@ +icdiff (1.9.4-1) unstable; urgency=medium + + * New upstream release. + * Bump Standards-Version. + * Respect nocheck setting in test override. + + -- Sascha Steinbiss Thu, 18 Oct 2018 10:35:44 +0200 + icdiff (1.9.3-1) unstable; urgency=medium * New upstream release. diff -Nru icdiff-1.9.3/debian/control icdiff-1.9.4/debian/control --- icdiff-1.9.3/debian/control 2018-08-18 10:06:39.000000000 +0000 +++ icdiff-1.9.4/debian/control 2018-10-18 08:35:44.000000000 +0000 @@ -9,7 +9,7 @@ python3-setuptools, help2man, flake8 -Standards-Version: 4.1.5 +Standards-Version: 4.2.1 Vcs-Browser: https://salsa.debian.org/debian/icdiff Vcs-Git: https://salsa.debian.org/debian/icdiff.git Homepage: http://www.jefftk.com/icdiff diff -Nru icdiff-1.9.3/debian/patches/please-flake8.patch icdiff-1.9.4/debian/patches/please-flake8.patch --- icdiff-1.9.3/debian/patches/please-flake8.patch 2018-08-18 10:07:49.000000000 +0000 +++ icdiff-1.9.4/debian/patches/please-flake8.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -Description: avoid use of 'l' as variable name - The idea is to avoid the characters 'l', 'O', or 'I' as variable - names because in some fonts they are indistinguishable from the - numerals one and zero. -Author: Sascha Steinbiss -Last-Update: 2017-12-12 ---- a/icdiff -+++ b/icdiff -@@ -276,7 +276,7 @@ - self._rpad(simple_colorize(str(lid), "line-numbers"), 8), text) - - def _real_len(self, s): -- l = 0 -+ lenval = 0 - in_esc = False - prev = ' ' - for c in replace_all({'\0+': "", -@@ -290,12 +290,12 @@ - else: - if c == "[" and prev == "\033": - in_esc = True -- l -= 1 # we counted prev when we shouldn't have -+ lenval -= 1 # we counted prev when we shouldn't have - else: -- l += self._display_len(c) -+ lenval += self._display_len(c) - prev = c - -- return l -+ return lenval - - def _rpad(self, s, field_width): - return self._pad(s, field_width) + s diff -Nru icdiff-1.9.3/debian/patches/series icdiff-1.9.4/debian/patches/series --- icdiff-1.9.3/debian/patches/series 2018-08-18 10:06:39.000000000 +0000 +++ icdiff-1.9.4/debian/patches/series 2018-10-18 08:35:20.000000000 +0000 @@ -1,2 +1 @@ use-python3.patch -please-flake8.patch diff -Nru icdiff-1.9.3/debian/rules icdiff-1.9.4/debian/rules --- icdiff-1.9.3/debian/rules 2018-08-18 10:06:39.000000000 +0000 +++ icdiff-1.9.4/debian/rules 2018-10-18 08:35:44.000000000 +0000 @@ -14,4 +14,6 @@ dh_installman -- override_dh_auto_test: +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) ./test.sh python3 +endif diff -Nru icdiff-1.9.3/git-icdiff icdiff-1.9.4/git-icdiff --- icdiff-1.9.3/git-icdiff 2018-08-09 12:51:07.000000000 +0000 +++ icdiff-1.9.4/git-icdiff 2018-10-17 16:12:06.000000000 +0000 @@ -14,4 +14,4 @@ GITPAGER="$GITPAGER -R" fi -git difftool --no-prompt --extcmd="icdiff $ICDIFF_OPTIONS $*" | $GITPAGER +git difftool --no-prompt --extcmd="icdiff $ICDIFF_OPTIONS" $* | $GITPAGER diff -Nru icdiff-1.9.3/icdiff icdiff-1.9.4/icdiff --- icdiff-1.9.3/icdiff 2018-08-09 12:51:07.000000000 +0000 +++ icdiff-1.9.4/icdiff 2018-10-17 16:12:06.000000000 +0000 @@ -23,7 +23,7 @@ import unicodedata import codecs -__version__ = "1.9.3" +__version__ = "1.9.4" color_codes = { "black": '\033[0;30m', @@ -276,7 +276,7 @@ self._rpad(simple_colorize(str(lid), "line-numbers"), 8), text) def _real_len(self, s): - l = 0 + s_len = 0 in_esc = False prev = ' ' for c in replace_all({'\0+': "", @@ -290,12 +290,12 @@ else: if c == "[" and prev == "\033": in_esc = True - l -= 1 # we counted prev when we shouldn't have + s_len -= 1 # we counted prev when we shouldn't have else: - l += self._display_len(c) + s_len += self._display_len(c) prev = c - return l + return s_len def _rpad(self, s, field_width): return self._pad(s, field_width) + s @@ -492,7 +492,8 @@ type="string", dest='labels', help="override file labels with arbitrary tags. " - "Use twice, one for each file") + "Use twice, one for each file. You may include the " + "formatting strings '{path}' and '{basename}'") parser.add_option("-N", "--line-numbers", default=False, action="store_true", help="generate output with line numbers. Not compatible " @@ -634,10 +635,23 @@ raise +def format_label(path, label="{path}"): + """Format a label using a file's path and basename. + + Example: + For file `/foo/bar.py` and label "Yours: {basename}" - + The ouptut is "Yours: bar.py" + """ + return label.format(path=path, basename=os.path.basename(path)) + + def diff_files(options, a, b): if options.labels: if len(options.labels) == 2: - headers = options.labels + headers = [ + format_label(a, options.labels[0]), + format_label(b, options.labels[1]), + ] else: codec_print("error: to use arbitrary file labels, " "specify -L twice.", options) diff -Nru icdiff-1.9.3/icdiff.py icdiff-1.9.4/icdiff.py --- icdiff-1.9.3/icdiff.py 2018-08-09 12:51:07.000000000 +0000 +++ icdiff-1.9.4/icdiff.py 2018-10-17 16:12:06.000000000 +0000 @@ -23,7 +23,7 @@ import unicodedata import codecs -__version__ = "1.9.3" +__version__ = "1.9.4" color_codes = { "black": '\033[0;30m', @@ -276,7 +276,7 @@ self._rpad(simple_colorize(str(lid), "line-numbers"), 8), text) def _real_len(self, s): - l = 0 + s_len = 0 in_esc = False prev = ' ' for c in replace_all({'\0+': "", @@ -290,12 +290,12 @@ else: if c == "[" and prev == "\033": in_esc = True - l -= 1 # we counted prev when we shouldn't have + s_len -= 1 # we counted prev when we shouldn't have else: - l += self._display_len(c) + s_len += self._display_len(c) prev = c - return l + return s_len def _rpad(self, s, field_width): return self._pad(s, field_width) + s @@ -492,7 +492,8 @@ type="string", dest='labels', help="override file labels with arbitrary tags. " - "Use twice, one for each file") + "Use twice, one for each file. You may include the " + "formatting strings '{path}' and '{basename}'") parser.add_option("-N", "--line-numbers", default=False, action="store_true", help="generate output with line numbers. Not compatible " @@ -634,10 +635,23 @@ raise +def format_label(path, label="{path}"): + """Format a label using a file's path and basename. + + Example: + For file `/foo/bar.py` and label "Yours: {basename}" - + The ouptut is "Yours: bar.py" + """ + return label.format(path=path, basename=os.path.basename(path)) + + def diff_files(options, a, b): if options.labels: if len(options.labels) == 2: - headers = options.labels + headers = [ + format_label(a, options.labels[0]), + format_label(b, options.labels[1]), + ] else: codec_print("error: to use arbitrary file labels, " "specify -L twice.", options) diff -Nru icdiff-1.9.3/MANIFEST.in icdiff-1.9.4/MANIFEST.in --- icdiff-1.9.3/MANIFEST.in 2018-08-09 12:51:07.000000000 +0000 +++ icdiff-1.9.4/MANIFEST.in 2018-10-17 16:12:06.000000000 +0000 @@ -1 +1,2 @@ include README.md +include LICENSE diff -Nru icdiff-1.9.3/README.md icdiff-1.9.4/README.md --- icdiff-1.9.3/README.md 2018-08-09 12:51:07.000000000 +0000 +++ icdiff-1.9.4/README.md 2018-10-17 16:12:06.000000000 +0000 @@ -135,6 +135,14 @@ ./test.sh python3 ``` +## Making a release + +* Update ChangeLog with all the changes since the last release +* Update `__version__` in `icdiff` +* Run tests, make sure they pass +* `git tag release-${version}` +* `git push origin release-${version}` + ## License This file is derived from `difflib.HtmlDiff` which is under [license](http://www.python.org/download/releases/2.6.2/license/). diff -Nru icdiff-1.9.3/tests/gold-45-lbrb.txt icdiff-1.9.4/tests/gold-45-lbrb.txt --- icdiff-1.9.3/tests/gold-45-lbrb.txt 1970-01-01 00:00:00.000000000 +0000 +++ icdiff-1.9.4/tests/gold-45-lbrb.txt 2018-10-17 16:12:06.000000000 +0000 @@ -0,0 +1,10 @@ +L input-4.txt R input-5.txt +#input, #button { #input, #button { + width: 350px; width: 400px; + height: 40px; height: 40px; +  font-size: 30px; + margin: 0px; margin: 0; + padding: 0px; padding: 0; + margin-bottom: 15px; + text-align: center; text-align: center; +} } diff -Nru icdiff-1.9.3/test.sh icdiff-1.9.4/test.sh --- icdiff-1.9.3/test.sh 2018-08-09 12:51:07.000000000 +0000 +++ icdiff-1.9.4/test.sh 2018-10-17 16:12:06.000000000 +0000 @@ -98,6 +98,7 @@ check_gold gold-45-h3.txt tests/input-{4,5}.txt --cols=80 --head=3 check_gold gold-45-l.txt tests/input-{4,5}.txt --cols=80 -L left check_gold gold-45-lr.txt tests/input-{4,5}.txt --cols=80 -L left -L right +check_gold gold-45-lbrb.txt tests/input-{4,5}.txt --cols=80 -L "L {basename}" -L "R {basename}" check_gold gold-45-pipe.txt tests/input-4.txt <(cat tests/input-5.txt) --cols=80 --no-headers check_gold gold-4dn.txt tests/input-4.txt /dev/null --cols=80 -L left -L right check_gold gold-dn5.txt /dev/null tests/input-5.txt --cols=80 -L left -L right