job000481 #2

  • //
  • spec/
  • job/
  • job000481
  • View
  • Commits
  • Open Download .zip Download (5 KB)
# The form data below was edited by perforce
# Perforce Workshop Jobs
#
#  Job:           The job name. 'new' generates a sequenced job number.
#
#  Status:        Job status; required field.  There is no enforced or
#                 promoted workflow for transition of jobs from one
#                 status to another, just a set of job status values
#                 for users to apply as they see fit.  Possible values:
#
#                 open - Issue is available to be worked on.
#
#                 inprogress - Active development is in progress.
#
#                 blocked - Issue cannot be implemented for some reason.
#
#                 fixed - Fixed, optional status to use before closed.
#                 
#                 closed - Issue has been dealt with definitively.
#
#                 punted - Decision made not to address the issue,
#                    possibly not ever.
#
#                 suspended - Decision made not to address the issue
#                    in the immediate future, but noting that it may
#                    have some merit and may be revisited later.
#
#                 duplicate - Duplicate of another issue that.
#
#                 obsolete - The need behind the request has become
#                    overcome by events.
#
#  Project:       The project this job is for. Required.
#
#  Severity:      [A/B/C] (A is highest)  Required.
#
#  ReportedBy     The user who created the job. Can be changed.
#
#  ReportedDate:  The date the job was created.  Automatic.
#
#  ModifiedBy:    The user who last modified this job. Automatic.
#
#  ModifiedDate:  The date this job was last modified. Automatic.
#
#  OwnedBy:       The owner, responsible for doing the job. Optional.
#
#  Description:   Description of the job.  Required.
#
#  DevNotes:      Developer's comments.  Optional.  Can be used to
#                 explain a status, e.g. for blocked, punted,
#                 obsolete or duplicate jobs.  May also provide
#                 additional information such as the earliest release
#                 in which a bug is known to exist.
#
# Component:      Projects may use this optional field to indicate
#                 which component of the project a givenjob is associated
#                 with.
#
#                 For the SDP, the list of components is defined in:
#                 //guest/perforce_software/sdp/tools/components.txt
#
#  Type:          Type of job [Bug/Feature].  Required.
#
#  Release:       Release in which job is intended to be fixed.

Job:	job000481

Status:	open

Project:	perforce-software-p4api-net

Severity:	A

ReportedBy:	norman_morse

ReportedDate:	2016/03/16 12:13:38

ModifiedBy:	perforce

ModifiedDate:	2019/02/19 10:51:31

OwnedBy:	norman_morse

Description:
	Can't get metadata for newly added files
	
	From internal case 00228248
	
	1. Add a file to a depot (e.g. p4.exe add //depot/file.txt)
	
	2. Get a list of opened files (IList<p4.File> p4Files = this.p4Repo.GetOpenedFiles(null, null);)
	
	3. Get metadata for the newly opened file (foreach (p4.File p4File in p4Files) { IList<p4.FileMetaData> metaList = this.p4Repo.GetFileMetaData(null, p4File); }
	
	Result:
	
	The metadata for that file will be null
	
	This is caused by two things:
	
	1. The FileSpec object that is returned by GetOpenedFiles has a revision number of 1 (see below.) Since this is a newly added file it doesn't actually have a revision number yet.
	
	- p4File {//depot/FMThresholdP4/external/SCAPI/Binaries/Microsoft.Scapi.Test.dll.config#1} Perforce.P4.File
	- base {//depot/FMThresholdP4/external/SCAPI/Binaries/Microsoft.Scapi.Test.dll.config#1} Perforce.P4.FileSpec {Perforce.P4.File}
	+ ClientPath {//dtunnell_T10-A8-DTUNNELL_FMThresholdP4/external/SCAPI/Binaries/Microsoft.Scapi.Test.dll.config} Perforce.P4.ClientPath
	+ DepotPath {//depot/FMThresholdP4/external/SCAPI/Binaries/Microsoft.Scapi.Test.dll.config} Perforce.P4.DepotPath
	LocalPath null Perforce.P4.LocalPath
	+ Version {#1} Perforce.P4.VersionSpec {Perforce.P4.Revision}
	
	2. Internal to GetFileMetaData in Repository.cs the revision number is added to the file. So in the example above it would run fstat on //depot/file.txt#1. That returns "no such files"
	
	As a workaround I'm setting the revision number to null for anything that is an add. By doing that it will successfully run p4 fstat and return the proper metadata. You can reproduce this behavior on the command line:
	
	p4 fstat //depot/FMThresholdP4/external/SCAPI/Binaries/Microsoft.Scapi.Test.dll.config
	
	... depotFile //depot/FMThresholdP4/external/SCAPI/Binaries/Microsoft.Scapi.Test.dll.config
	... clientFile F:\Perforce\All\FMThresholdP4\external\SCAPI\Binaries\Microsoft.Scapi.Test.dll.config
	... isMapped
	... action add
	... change 486786
	... type utf8
	... actionOwner REDMOND\dtunnell
	
	p4 fstat //depot/FMThresholdP4/external/SCAPI/Binaries/Microsoft.Scapi.Test.dll.config#1
	
	//depot/FMThresholdP4/external/SCAPI/Binaries/Microsoft.Scapi.Test.dll.config#1 - no such file(s).
	
	Note that setting the revision to zero will not work:
	
	p4 fstat //depot/FMThresholdP4/external/SCAPI/Binaries/Microsoft.Scapi.Test.dll.config#0
	
	//depot/FMThresholdP4/external/SCAPI/Binaries/Microsoft.Scapi.Test.dll.config#0 - no such file(s).

DevNotes:

Type:	Bug
# Change User Description Committed
#2 default
#1 default