fixed tags for gitGraph

This commit is contained in:
Austin Fulbright
2024-07-26 22:55:40 -04:00
parent 1af90946bc
commit a386bd0b74
4 changed files with 9 additions and 9 deletions

View File

@@ -279,7 +279,7 @@ export const merge = (
export const cherryPick = function (
sourceId: string,
targetId: string,
tags: string[],
tags: string[] | undefined,
parentCommitId: string
) {
log.debug('Entering cherryPick:', sourceId, targetId, tags);

View File

@@ -45,8 +45,9 @@ const parseStatement = (statement: any) => {
const parseCommit = (commit: CommitAst) => {
const id = commit.id;
const message = commit.message ?? '';
const tags = commit.tags ?? [];
const tags = commit.tags ?? undefined;
const type = commit.type !== undefined ? commitType[commit.type] : 0;
log.info(`Commit: ${id} ${message} ${type}`);
db.commit(message, id, type, tags);
};
@@ -59,7 +60,7 @@ const parseBranch = (branch: BranchAst) => {
const parseMerge = (merge: MergeAst) => {
const branch = merge.branch;
const id = merge.id ?? '';
const tags = merge.tags ?? [];
const tags = merge.tags ?? undefined;
const type = merge.type !== undefined ? commitType[merge.type] : 0;
db.merge(branch, id, type, tags);
};
@@ -71,7 +72,7 @@ const parseCheckout = (checkout: CheckoutAst) => {
const parseCherryPicking = (cherryPicking: CherryPickingAst) => {
const id = cherryPicking.id;
const tags = cherryPicking.tags ?? [];
const tags = cherryPicking.tags ?? undefined;
const parent = cherryPicking.parent;
db.cherryPick(id, '', tags, parent);
};

View File

@@ -5,7 +5,7 @@ export interface Commit {
message: string;
seq: number;
type: number;
tags: string[] | undefined;
tags: string[];
parents: (string | null)[];
branch: string;
customType?: number;

View File

@@ -45,7 +45,6 @@ Statement
| CherryPicking
;
Direction:
dir=('LR' | 'TB' | 'BT');
@@ -57,7 +56,7 @@ Commit:
(
'id:' id=STRING
|'msg:'? message=STRING
|'tag:' tags=STRING
|'tag:' tags+=STRING
|'type:' name=('NORMAL' | 'REVERSE' | 'HIGHLIGHT')
)* EOL;
Branch:
@@ -69,7 +68,7 @@ Merge:
'merge' branch=(ID|STRING)
(
'id:' id=STRING
|'tag:' tags=STRING
|'tag:' tags+=STRING
|'type:' name=('NORMAL' | 'REVERSE' | 'HIGHLIGHT')
)* EOL;
@@ -80,7 +79,7 @@ CherryPicking:
'cherry-pick'
(
'id:' id=STRING
|'tag:' tags=STRING
|'tag:' tags+=STRING
|'parent:' id=STRING
)* EOL;