Skip to content

Commit

Permalink
np4: Handle missing head info for depot file (#261)
Browse files Browse the repository at this point in the history
* np4: Handle missing head info for depot file

* np4: Bump version number
  • Loading branch information
BastianBlokland authored Jul 8, 2022
1 parent ba4598e commit 12a76fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion utilities/np4/app.ns
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ cli(cliCmd("status", statusCmd, "Print the status of the current workspace
cliCmd("streams", streamsCmd, "Print a graph of all the streams on the server"),
cliAppInfo(
"Novus P4", "Convenience wrapper around the p4 perforce client.",
Version(0, 13, 0)))
Version(0, 14, 0)))
17 changes: 12 additions & 5 deletions utilities/np4/perforce/data/file.ns
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "path.ns"

// -- Types.

enum P4FileOp = Add, Edit, Delete, Branch, MoveAdd, MoveDelete, Integrate, Import, Purge, Archive
enum P4FileOp = Add, Edit, Delete, Branch, MoveAdd, MoveDelete, Integrate, Import, Purge, Archive, Unknown

struct P4FileRev = long i

Expand All @@ -21,10 +21,10 @@ struct P4FileInfo =
struct P4DepotFileInfo =
P4DepotPath depotFile,
Option{P4ClientPath} clientFile,
P4FileOp headAction,
Option{P4FileOp} headAction,
Option{string} headType,
P4FileRev headRev,
P4Change headChange
Option{P4FileRev} headRev,
Option{P4Change} headChange

struct P4FileLocation =
P4DepotPath depotFile,
Expand All @@ -39,7 +39,14 @@ fun string(P4FileRev r)
else -> r.i.string()

fun P4FileInfo(P4DepotFileInfo f)
P4FileInfo(f.depotFile, f.clientFile, f.headAction, f.headType, f.headRev, f.headChange)
P4FileInfo(
f.depotFile,
f.clientFile,
f.headAction ?? P4FileOp.Unknown,
f.headType,
f.headRev ?? P4FileRev(0),
f.headChange ?? P4Change(0)
)

// -- Utilities.

Expand Down

0 comments on commit 12a76fe

Please sign in to comment.