forked from paulfitz/daff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChange.hx
39 lines (34 loc) · 1.05 KB
/
Change.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// -*- mode:java; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
#if !TOPLEVEL
package coopy;
#end
@:expose
class Change {
// toy
public var change : String;
public var parent : ViewedDatum;
public var local : ViewedDatum;
public var remote : ViewedDatum;
public var mode : ChangeType;
public function new(?txt : String) : Void {
if (txt!=null) {
mode = NOTE_CHANGE;
change = txt;
} else {
mode = NO_CHANGE;
}
}
public function getMode() : String {
return ""+mode;
}
public function toString() : String {
return switch(mode) {
case NO_CHANGE: "no change";
case LOCAL_CHANGE: "local change: " + remote + " -> " + local;
case REMOTE_CHANGE: "remote change: " + local + " -> " + remote;
case BOTH_CHANGE: "conflicting change: " + parent + " -> " + local + " / " + remote;
case SAME_CHANGE: "same change: " + parent + " -> " + local + " / " + remote;
case NOTE_CHANGE: change;
}
}
}