• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

antonvw / wex / 24932513120

25 Apr 2026 01:57PM UTC coverage: 64.281% (-0.05%) from 64.326%
24932513120

push

github

web-flow
1202 allow comparing file using unified diff (#1232)

* first step, update the unified diff class to handle non git diffs

* when using diff as comparator add U0 flags, and changes for process::system

* factory::unified_diff now reports diff

* added ui item for unified diff opening for lists

* fixed path for unified diff: it is before the tab

* and added test for the paths

* changes after review

18754 of 32046 branches covered (58.52%)

Branch coverage included in aggregate %.

14955 of 20394 relevant lines covered (73.33%)

1457.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

45.24
/src/vcs/unified-diff.cpp
1
////////////////////////////////////////////////////////////////////////////////
2
// Name:      unified-diff.cpp
3
// Purpose:   Implementation of class wex::unified_diff (for git)
4
//            https://git-scm.com/docs/diff-format
5
// Author:    Anton van Wezenbeek
6
// Copyright: (c) 2024-2026 Anton van Wezenbeek
7
////////////////////////////////////////////////////////////////////////////////
8

9
#include <wex/core/log.h>
10
#include <wex/factory/frame.h>
11
#include <wex/vcs/unified-diff.h>
12
#include <wex/vcs/vcs-entry.h>
13
#include <wex/vcs/vcs.h>
14

15
wex::unified_diff::unified_diff(
1✔
16
  const path&      p,
17
  const vcs_entry* e,
18
  factory::frame*  f)
1✔
19
  : factory::unified_diff(e->std_out(), f)
1✔
20
  , m_path_vcs(p)
1✔
21
  , m_frame(f)
1✔
22
  , m_path_toplevel(vcs().toplevel())
1✔
23
  , m_vcs_entry(e)
1✔
24
{
25
}
1✔
26

27
bool wex::unified_diff::report_diff()
×
28
{
29
  m_path_vcs = path(m_path_toplevel).append(m_path[0]);
×
30

31
  if (!m_path_vcs.dir_exists())
×
32
  {
33
    if (!m_path_vcs.file_exists())
×
34
    {
35
      log("unified_diff") << m_path_vcs.string() << "does not exist";
×
36
      return false;
×
37
    }
38

39
    if (!m_frame->report_unified_diff(this))
×
40
    {
41
      return false;
×
42
    }
43
  }
44

45
  return true;
×
46
}
47

48
std::string wex::unified_diff::token_from() const
1✔
49
{
50
  return "a/";
2✔
51
}
52

53
std::string wex::unified_diff::token_to() const
1✔
54
{
55
  return "b/";
2✔
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc