diff options
| author | Jeff Carr <[email protected]> | 2025-02-02 13:31:05 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-02 15:07:23 -0600 |
| commit | 9baa477990a8b6555e1a70c09a5411e80e344334 (patch) | |
| tree | 4750d941e9d9b19306b531bcad2b2f8d733454e9 /patchset.Make.go | |
| parent | ab01c2cd60331d55f5c6d5b033d2cd422fb020b4 (diff) | |
add a date and a uuid to the patchsetv0.0.72
Diffstat (limited to 'patchset.Make.go')
| -rw-r--r-- | patchset.Make.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/patchset.Make.go b/patchset.Make.go index 5081cb9..08b8ccc 100644 --- a/patchset.Make.go +++ b/patchset.Make.go @@ -6,9 +6,12 @@ import ( "os" "path/filepath" "strings" + "time" + "github.com/google/uuid" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) // creates a patchset @@ -16,6 +19,8 @@ import ( func (f *Forge) MakeDevelPatchSet(name string) (*Patchset, error) { pset := new(Patchset) pset.Name = name + pset.Ctime = timestamppb.New(time.Now()) + pset.Uuid = uuid.New().String() if os.Getenv("GIT_AUTHOR_NAME") == "" { return nil, fmt.Errorf("GIT_AUTHOR_NAME not set") } else { @@ -142,7 +147,9 @@ func (pset *Patchset) makePatchSetNew(repo *gitpb.Repo) error { return nil } - return pset.addPatchFiles(repo) + err = pset.addPatchFiles(repo) + pset.Ctime = timestamppb.New(time.Now()) + return err } // process each file in pDir/ @@ -184,6 +191,7 @@ func (p *Patchset) addPatchFiles(repo *gitpb.Repo) error { p.Patches = new(Patches) } p.Patches.Append(patch) + p.Patches.Uuid = uuid.New().String() // log.Info("ADDED PATCH FILE", path) return nil }) |
