Reputation: 256701
i am trying to figure out how to get the Date of an item. The date i'm interested in is the Date that appears in the SourceSafe user interface:
In this example, the date is 6/9/2020 11:49 am
Using the Microsoft Visual SouceSafe COM API, you have access to an IVssItem
:
//InterfaceID: {2A0DE0EA-2E9F-11D0-9236-00AA00A1EB95}
public interface IVSSItem
{
public string Spec { get; set; }
public Boolean Binary { get; set; }
public Boolean Deleted { get; set; }
public VSSItemType Type { get; }
public String LocalSpec { get; set; }
public String Name { get; set; }
public IVSSItem Parent { get; }
public Int32 VersionNumber { get; }
public IVSSItems Items(Boolean IncludeDeleted) { get; }
public void Get(ref String Local; VSSFlags iFlags);
public void Checkout(String Comment, String Local, VSSFlags iFlags);
public void Checkin(String Comment, String Local, VSSFlags iFlags);
public UndoCheckout(String Local, VSSFlags iFlags);
public VSSFileStatus IsCheckedOut { get; }
public IVSSCheckouts Checkouts { get; }
public Boolean IsDifferent(String Local) { get; }
public IVSSItem Add(String Local, String Comment, VSSFlags iFlags);
public IVSSItem NewSubproject(String Name, String Comment);
public void Share(IVSSItem pIItem: IVSSItem, String Comment, VSSFlags iFlags);
public void Destroy();
public void Move(IVSSItem pINewParent);
public void Label(String Label, String Comment);
public IVSSVersions Versions(VSSFlags iFlags) { get; }
public IVSSItem Version(VARIANT Version) { get; }
public IVSSItems Links { get; }
public IVSSItem Branch(String Comment, VSSFlags iFlags);
}
The issue is that i don't see any way to access that Date that can be seen in the SourceSafe user interface.
Johannnes Knaupp asked the same question in 2001. In that thread, some suggested that the way to find the date of an item is to look at the date of the last IVssVersion.
IVSSVersion
does indeed have a date:
//InterfaceID {783CD4E8-9D54-11CF-B8EE-00608CC9A71F}
public interface IVSSVersion
{
String Username { get; }
Int32 VersionNumber { get; }
String Action { get; }
DateTime Date { get; } <--------------------
String Comment { get; }
String Label { get; }
String IVSSItem VSSItem { get; }
}
Unfortunately:
This can even be seen in the SourceSafe user interface:
And it can be confirmed through the API.
Johannes noted this back in 2001:
These dates are not the same:
A file created at 10:05 may be checked in at 10:08.
What's more is that IVssVersion.Date
doesn't represent a change to the file. It represents some action was taken:
Even worse:
6/19/1999
today6/19/1999
So the question is:
DateTime
of a file?Upvotes: 1
Views: 92