Skip to content

changes() should return a clear message when two versions are identical #2

@practicalmind-dev

Description

@practicalmind-dev

When two versions have identical content, changes() currently returns:

system  |  v1 -> v2
=======================================================

+ ADDED (0 lines)
- REMOVED (0 lines)

This is misleading, it looks like a result when there isn't one. The expected behaviour is a clear, explicit message.

Expected output:

No changes between v1 and v2.

Where to look

The logic lives in [graver/core.py] inside the changes() method. After the diff is computed, check whether both added and removed are empty and return early with the message.

A test should be added to tests/test_core.py covering the case where the same content is saved twice.

Scope

Only changes() in core.py and one new test case. No other files need to change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions