Skip to content

Commit

Permalink
1.6 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBachmann committed May 14, 2018
1 parent c39d0a0 commit 1348b9c
Show file tree
Hide file tree
Showing 9 changed files with 552 additions and 544 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SOS v1.5.4 #
# SOS v1.6 #

[![Travis badge](https://travis-ci.org/ArneBachmann/sos.svg?branch=master)](https://travis-ci.org/ArneBachmann/sos)
[![Build status](https://ci.appveyor.com/api/projects/status/fe915rtx02buqe4r?svg=true)](https://ci.appveyor.com/project/ArneBachmann/sos)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os, shutil, subprocess, sys, time, unittest
from setuptools import setup, find_packages

RELEASE = "1.5.4"
RELEASE = "1.6"
COMPATIBILITY_LEVEL = "3.4"

print("sys.argv is %r" % sys.argv)
Expand Down
2 changes: 1 addition & 1 deletion sos/sos.coco
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ def update(argument:str, options:str[] = [], onlys:FrozenSet[str]? = None, excps
else:
info("Nothing to update") # but write back updated branch info below
else: # integration required
add_all:str?; del_all:str?; selection:str
add_all:str?; del_all:str?; selection:str # user input markers to continue to add/delete all remaining
if changed.deletions.items(): printo("Additions:")
for path, pinfo in changed.deletions.items(): # file-based update. Deletions mark files not present in current file tree -> needs addition!
selection = "y" if mrg.value & MergeOperation.INSERT.value else "n" # default for non-ask case
Expand Down
8 changes: 4 additions & 4 deletions sos/sos.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# __coconut_hash__ = 0x8a4aeb41
# __coconut_hash__ = 0x7a0b1bf1

# Compiled with Coconut version 1.3.1-post_dev28 [Dead Parrot]

Expand Down Expand Up @@ -916,9 +916,9 @@ def update(argument: 'str', options: '_coconut.typing.Sequence[str]'=[], onlys:
else: # line 779
info("Nothing to update") # but write back updated branch info below # line 780
else: # integration required # line 781
add_all = None # type: _coconut.typing.Optional[str] # line 782
del_all = None # type: _coconut.typing.Optional[str] # line 782
selection = None # type: str # line 782
add_all = None # type: _coconut.typing.Optional[str] # user input markers to continue to add/delete all remaining # line 782
del_all = None # type: _coconut.typing.Optional[str] # user input markers to continue to add/delete all remaining # line 782
selection = None # type: str # user input markers to continue to add/delete all remaining # line 782
if changed.deletions.items(): # line 783
printo("Additions:") # line 783
for path, pinfo in changed.deletions.items(): # file-based update. Deletions mark files not present in current file tree -> needs addition! # line 784
Expand Down
4 changes: 4 additions & 0 deletions sos/tests.coco
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,10 @@ class Tests(unittest.TestCase):
a = b"a\nb\ne" # intra-line merge
_.assertEqual(b, mockInput(["i"], -> sos.merge(a, b, charMergeOperation = sos.MergeOperation.ASK)[0]))
_.assertEqual(a, mockInput(["t"], -> sos.merge(a, b, charMergeOperation = sos.MergeOperation.ASK)[0]))
_.assertEqual(b"aabaacaaa", sos.merge(b"aabaacaaa", b"aaaacaaa")[0])
_.assertEqual(b"aabaacaaa", sos.merge(b"aabaacaaa", b"aaaaaaa")[0])
_.assertEqual(b"aabaacaaa", sos.merge(b"aabaacaaa", b"aabaacaaaa")[0])
_.assertEqual(b"aabaacaaa", sos.merge(b"aabaacaaa", b"xaaaadaaac")[0])

def testMergeEol(_):
_.assertEqual(b"\r\n", sos.merge(b"a\nb", b"a\r\nb")[1])
Expand Down
1,050 changes: 527 additions & 523 deletions sos/tests.py

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions sos/utility.coco
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ def merge(
ignoreWhitespace:bool = False
) -> Tuple[Union[bytes,List[MergeBlock]],bytes?] =
''' Merges other binary text contents 'file' (or reads file 'filename') into current text contents 'into' (or reads file 'intoname'), returning merged result.
For update, the other version is assumed to be the "new/added" one, while for diff, the current changes are the ones "added".
For 'sos update', the other version is assumed to be the "new/added" one, while for diff, the 'file' with changes is the one shown as "added".
However, change direction markers are insert ("+") for elements only in into, and remove ("-") for elements only in other file (just like the diff marks +/-)
diffOnly returns detected change blocks only, no text merging
eol flag will use the other file's EOL marks
in case of replace block and INSERT strategy, the change will be added **behind** the original
diffOnly: if True, return detected change blocks only, no actual text merging
eol: if True, will use the other file's EOL marks
in case of replace block and INSERT strategy, the change will be added **behind** the original. HINT could be configurable
'''
encoding:str; othr:str[]; othreol:bytes?; curr:str[]; curreol:bytes?
try: # load files line-wise and normalize line endings (keep the one of the current file) TODO document
Expand Down Expand Up @@ -321,7 +321,7 @@ def merge(
elif last == "?": offset += 1 # marker for intra-line change comment HINT was earlier part of the MergeBlock
last = line[0]
tmp[:] = [line[2:]] # only keep current line for next block
# TODO add code to detect block moved blocks here
# TODO add code to detect moved blocks here
nl:bytes = othreol if eol else (curreol ?? othreol) # no default newline, to mark "no newline"
debug("Diff blocks: " + repr(blocks))
if diffOnly: return (blocks, nl)
Expand Down
12 changes: 6 additions & 6 deletions sos/utility.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# __coconut_hash__ = 0x397bd66b
# __coconut_hash__ = 0x229ab968

# Compiled with Coconut version 1.3.1-post_dev28 [Dead Parrot]

Expand Down Expand Up @@ -413,11 +413,11 @@ def user_block_input(output: 'List[str]'): # line 270

def merge(file: '_coconut.typing.Optional[bytes]'=None, into: '_coconut.typing.Optional[bytes]'=None, filename: '_coconut.typing.Optional[str]'=None, intoname: '_coconut.typing.Optional[str]'=None, mergeOperation: 'MergeOperation'=MergeOperation.BOTH, charMergeOperation: 'MergeOperation'=MergeOperation.BOTH, diffOnly: 'bool'=False, eol: 'bool'=False, ignoreWhitespace: 'bool'=False) -> 'Tuple[Union[bytes, List[MergeBlock]], _coconut.typing.Optional[bytes]]': # line 278
''' Merges other binary text contents 'file' (or reads file 'filename') into current text contents 'into' (or reads file 'intoname'), returning merged result.
For update, the other version is assumed to be the "new/added" one, while for diff, the current changes are the ones "added".
For 'sos update', the other version is assumed to be the "new/added" one, while for diff, the 'file' with changes is the one shown as "added".
However, change direction markers are insert ("+") for elements only in into, and remove ("-") for elements only in other file (just like the diff marks +/-)
diffOnly returns detected change blocks only, no text merging
eol flag will use the other file's EOL marks
in case of replace block and INSERT strategy, the change will be added **behind** the original
diffOnly: if True, return detected change blocks only, no actual text merging
eol: if True, will use the other file's EOL marks
in case of replace block and INSERT strategy, the change will be added **behind** the original. HINT could be configurable
''' # line 293
encoding = None # type: str # line 294
othr = None # type: _coconut.typing.Sequence[str] # line 294
Expand Down Expand Up @@ -463,7 +463,7 @@ def merge(file: '_coconut.typing.Optional[bytes]'=None, into: '_coconut.typing.O
offset += 1 # marker for intra-line change comment HINT was earlier part of the MergeBlock # line 321
last = line[0] # line 322
tmp[:] = [line[2:]] # only keep current line for next block # line 323
# TODO add code to detect block moved blocks here
# TODO add code to detect moved blocks here
nl = othreol if eol else ((othreol if curreol is None else curreol)) # type: bytes # no default newline, to mark "no newline" # line 325
debug("Diff blocks: " + repr(blocks)) # line 326
if diffOnly: # line 327
Expand Down
6 changes: 3 additions & 3 deletions sos/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version_info__ = (2018, 1512, 2741)
__version__ = r'2018.1512.2741-v1.5.0-48-gbc08f48'
__release_version__ = '1.5.4'
__version_info__ = (2018, 1514, 3110)
__version__ = r'2018.1514.3110-v1.5.0-49-gc39d0a0'
__release_version__ = '1.6'

0 comments on commit 1348b9c

Please sign in to comment.