Jump to content

source code file date changes (seemingly) randomly


Kevin Kitowski

Recommended Posts

Sometimes, when I switch my workspace from one branch to another, several, but not all, of the source code files within one of the folders are updated with the current date.  Is this a bug?  Or, is there any way I can preserve the file date of my source code files?  Some of the files which now have today's date haven't changed in many years...

 

I have 'update operation sets repository timestamps on files' *unchecked*

 

Thanks in advance for any/all replies and advice...

Link to comment
Share on other sites

Hi,

 

If you check "update operation sets repository timestamps on files", date file field will be automatically updated with the date that the files were committed into the repository.

 

If you uncheck "update operation sets repository timestamps on files", date file field will be automatically updated with the current date when you perform the update operation.

 

I´m not sure if I´m answering your question, but you don´t need to change the date file, you only have to decide which of the two showing date options prefer.

 

Regards,

Carlos


 

 
Link to comment
Share on other sites

Hi Carlos,

 

Thanks again for your replies.

 

I'm talking about the file timestamps on my source files on my hard drive.  The dates/timestamps are wrong now, but I can copy files onto my hard drive which have the right date.  How do I update these files in the repository such that they retain their original date/timestamps?  Some of the files are fairly old, with timestamps much earlier than when we implemented Plastic SCM.

 

Please let me know what you think.

 

Best regards, Kevin

Link to comment
Share on other sites

Do you have a build system or any program that maybe is changing timestamp?  The only Plastic operation modifying time stamp is update operation.  You said only a few files are affected.

 

Is there  a pattern you can reproduce to show us what´s happening? If so, we can get connected to check what is the problem.

 

 

Best regards,

Carlos

Link to comment
Share on other sites

Hi Carlos,

 

For now, let's assume that checking  "update operation sets repository timestamps on files" will prevent this from happening again,

 

So, how do I fix the source files that have a wrong date?  If, for example, I checkout a file with a date of 2/4/2013 and replace it with a file with a date of 2/14/2012 and check it in, it doesn't change the date.  Perhaps this is because the files are otherwise identical and Plastic thinks it should keep the latest one?

 

Please let me know what you think.

 

Thanks in advance for your help

 

Best regards, Kevin

Link to comment
Share on other sites

Hi,

 

If you delete a file and then you add a file that is exactly the same, Plastic detects the file as changed because of the different timestamp, but when you try to checkin, a new changeset is not created  because Plastic detects there aren´t modifications into the file, and leaves the first file with the first timestamp, so I am afraid this is not possible to change timestamp this way :(

 

Regards,

Carlos

Link to comment
Share on other sites

Hi Carlos,

 

So, how can I change it?  Can I check it out, make a frivolous change, check it in, check it out again, replace it with the 'old' file (with the correct timestamp) and then check it in again?

 

Please let me know what you think.

 

Thanks in advance.

 

Best regards, Kevin

Link to comment
Share on other sites

  • 1 month later...

Hi Carlos (or anyone else... :-)),

 

I'm finally getting around to trying to fix my source file timestamps.  I have "update operation sets repository timestamps on files" checked. So, I made a frivolous change to my source files and checked them in (with todays's date).  Then, I copied the files with correct dates to my source folder and checked them in.  At that point, it all looks good and I have the dates I want on my source files.  Then, I switch my workspace to another branch and then switch back again and all the timestamps on my source files are todays date.  What am I doing wrong and how to I get plastic to preserve the source file dates that I need?

 

Thanks in advance for your help.

 

Best regards, Kevin

Link to comment
Share on other sites

Hi,

 

The only Plastic preference managing timestamps is"update operation sets repository timestamps on files" preference.

If you check "update operation sets repository timestamps on files" option when you switch workspace to a different changeset, files won´t be updated with the current date.

 

Regrads,

Carlos

Link to comment
Share on other sites

Hi, reviewed the document. I´m going to explain how Plastic manages timestamps.

When you commit a file to the repository, the date when you perform the operation is stored and:

- If you check "update operation sets repository timestamps on files", date file field will be automatically updated with the date that the files were committed into the repository.

- If you uncheck "update operation sets repository timestamps on files", date file field will be automatically updated with the current date when you perform the update operation.- 

It doesn´t matter if a file is 2 years old. If you create the revision today, that´s the date stored in the repository. When you are switching between different changesets, you are getting the date when revisions where created (checkin was performed).

It would be possible to change the timestamps in the repository (you perform a checkin today, but you want it to be stored as it was 2 years ago), be it´s necessary to hack the database.

Regards,
Carlos

Link to comment
Share on other sites

Hi Carlos,

 

Thanks for your reply.

 

But there must be some way to preserve the ‘original’ date because I have files that were first checked into Plastic in February 2013 which have dates much earlier that.   Is there no way to reset a file to it’s ‘original’ date?

 

Please let me know what you think.

 

Thanks again for your help.

 

Best regards, Kevin

Link to comment
Share on other sites

Hi Kevin,

 

I think the files you still have with the old dates have never been updated by Plastic, it's more or lees what Carlos said.

 

1) You have a 3 years old file.

2) Add + Ci. -> The date on disk  is still 3 years old but the revision and changeset created are having "DateTime.Now" as the timestamp.

3) Update in a different and new workspace 

3.1) Default: The file timestamp will be the time when the file was written on your drive.

3.2) Rep options: The file timestamp will be the changeset one.

 

There are several ways to tell the server "commit and use this timestamp" but it's only available for importers/migration purposes.

 

If you want you can add the idea into our user voice page and let the people vote for your idea. https://plasticscm.uservoice.com/

 

Best regards,

Manu.

Link to comment
Share on other sites

Hi Manu,

 

Thanks for your help on this.   I did add this as a suggestion on the voice page (thanks for suggesting this).

 

In the mean time, Carlos mentioned that there might be a one-time workaround.  I think I would like to try that.  Please let me know what I need to do.

 

Thanks in advance for your help.

 

Best regards, Kevin

Link to comment
Share on other sites

Hi Kevin,

 

We have prepared a small program that may help you. Let me explain how it works. We tested for SQLite, so it will be better if you use that backend.

 

- Open your rep_x.plastic file with a database manager. When you create a changeset, a few objects are generated in "object" table. These objects generated have a "dtimestamp" (tick format).

- Now using the program, you have to indicate the value of the "dtiemstamp" and the number of days you want to subtract and the program will give you the new "dtimestamp" value you will need to set in the database.

 

Each time you create a changeset a few objects are generated. If you want to change the date of a concrete changeset and revisions included:

- Go to changeset table and check the "iobjid". Then search all the objects with this "iobjid" in "objects" table. Finally change the "dtimestamp" value in all all the objects searched.

 

I hope it helps you a bit to find a solution for your issue. I´ve sent you the program to your e-mail

 

Best regards,

Carlos

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...