intersystems-community / cache-tort-git

Access to Tortoise Git interface from Caché Studio
https://github.com/intersystems-ru/cache-tort-git/wiki
MIT License
31 stars 20 forks source link

I can not save a new file in a .csp already versioned folder #22

Closed lucasscarduelli closed 9 years ago

lucasscarduelli commented 9 years ago

After I add a folder with CSP pages to version control I can not create any more .csp file in it.

After creating the new file I try to save him and the error message as the image below.

bug

My workstation is in pt-BR, so the translation of the message is: "ERROR #5012: The file 'c:\temp\TESTE_VERSIONAMENTO\csp\teste\Untitled4.csp.xml' not exists"

lucasscarduelli commented 9 years ago

Pull request #23

adaptun commented 9 years ago

Can you please provide output of zwrite ^Git from namespace where error happens

lucasscarduelli commented 9 years ago

This file really not exists, the problem is the "OnBeforeLoad" from %SourceControl.Git is executed before creating the file also.

adaptun commented 9 years ago

I don't think that this is the problem OnBeforeLoad should not throw error if there are no external file.

lucasscarduelli commented 9 years ago

Yes, i agree. The problem happens when the " LoadIfOutdated " method tries to load the file and it does not exist. I think we can fix this by validating method if the file actually exists.

lucasscarduelli commented 9 years ago

Ok, it's resolved but my last commit resolved a potencial bug too. You can merge?

adaptun commented 9 years ago

I think we don't need to check that file exists in LoadIfOutdated because IsRoutineOutdated should return false if there is no corresponding file on disk, so there is no need to merge.

lucasscarduelli commented 9 years ago

In my opinion the most correct is to validate if the file or routine exists and don't set a fictious date to this. So for me the responsibilities of validations are confused , if we think of quality as correct code would be to separate these validations .