Jump to content


Photo

source code file date changes (seemingly) randomly


  • Please log in to reply
23 replies to this topic

#1 Kevin Kitowski

Kevin Kitowski

    Member

  • Members
  • PipPip
  • 13 posts

Posted 28 February 2013 - 03:57 PM

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...



#2 calbzam

calbzam

    Advanced Member

  • Administrators
  • 157 posts

Posted 28 February 2013 - 04:58 PM

Hello,

 

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.

 

Regards,

Carlos



#3 Kevin Kitowski

Kevin Kitowski

    Member

  • Members
  • PipPip
  • 13 posts

Posted 01 March 2013 - 04:07 PM

Hi Carlos,

 

Thanks for the reply

 

So, now I have a bunch of files with the wrong date, possibly even the wrong date in the repository.  How do I get them into the repository with the right date?

 

Please let me know what you think.

 

Thanks again

 

Best regards, Kevin



#4 calbzam

calbzam

    Advanced Member

  • Administrators
  • 157 posts

Posted 01 March 2013 - 04:26 PM

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


 

 


#5 Kevin Kitowski

Kevin Kitowski

    Member

  • Members
  • PipPip
  • 13 posts

Posted 01 March 2013 - 06:43 PM

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



#6 calbzam

calbzam

    Advanced Member

  • Administrators
  • 157 posts

Posted 04 March 2013 - 09:18 AM

Hi,

 

One question which operating system are you using? Is it MAC or Linux?

 

Regards,
Carlos



#7 Kevin Kitowski

Kevin Kitowski

    Member

  • Members
  • PipPip
  • 13 posts

Posted 04 March 2013 - 06:35 PM

Hi Carlos,

 

My operating system is Windows 7 SP1, 64 bit

 

Best regards, Kevin



#8 calbzam

calbzam

    Advanced Member

  • Administrators
  • 157 posts

Posted 05 March 2013 - 03:32 PM

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



#9 Kevin Kitowski

Kevin Kitowski

    Member

  • Members
  • PipPip
  • 13 posts

Posted 05 March 2013 - 10:22 PM

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



#10 calbzam

calbzam

    Advanced Member

  • Administrators
  • 157 posts

Posted 06 March 2013 - 03:49 PM

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



#11 Kevin Kitowski

Kevin Kitowski

    Member

  • Members
  • PipPip
  • 13 posts

Posted 07 March 2013 - 03:26 PM

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



#12 calbzam

calbzam

    Advanced Member

  • Administrators
  • 157 posts

Posted 07 March 2013 - 04:11 PM

Hello, 

 

Yes, this way should work in your case, but one thing, check-out step is not necessary, you can use modify- chekin workflow ( http://www.plasticsc...t-workflow.aspx ).

Of course, if you are more comfortable with check-out workflow you can work do this way.

 

Best regards,

Carlos



#13 Kevin Kitowski

Kevin Kitowski

    Member

  • Members
  • PipPip
  • 13 posts

Posted 03 May 2013 - 04:36 PM

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



#14 calbzam

calbzam

    Advanced Member

  • Administrators
  • 157 posts

Posted 06 May 2013 - 10:53 AM

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



#15 Kevin Kitowski

Kevin Kitowski

    Member

  • Members
  • PipPip
  • 13 posts

Posted 08 May 2013 - 03:53 PM

Hi Carlos,

 

This still isn't working.

 

Is there a way I can send you a Word document showing the exact steps I'm taking?

 

Please let me know what you think.

 

Thanks in advance for your help.

 

Best regards, Kevin

 

 

 



#16 calbzam

calbzam

    Advanced Member

  • Administrators
  • 157 posts

Posted 08 May 2013 - 04:06 PM

yes, send me the info to:  calba at codicesoftware dot com

 

Regards,

Carlos



#17 Kevin Kitowski

Kevin Kitowski

    Member

  • Members
  • PipPip
  • 13 posts

Posted 08 May 2013 - 04:42 PM

sent it



#18 calbzam

calbzam

    Advanced Member

  • Administrators
  • 157 posts

Posted 10 May 2013 - 08:50 AM

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



#19 Kevin Kitowski

Kevin Kitowski

    Member

  • Members
  • PipPip
  • 13 posts

Posted 10 May 2013 - 11:59 AM

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



#20 manu

manu

    Advanced

  • Administrators
  • 2,106 posts

Posted 14 May 2013 - 01:54 PM

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.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users