Xcode - Restore Snapshot - File does not exist in restore location - xcode4

When I tries to Restore Snapshop, the right pane instead of highlighting the changes, comes up with the message 'Files does not exist in restore location'. Then, even i clicks 'restore', nothing changes. But if i go to Organizer-Projects, the snapshots are there and I can export it and restore from there. Guess i can do it that way, but it's more convenient to restore to the original location.
I'm running XCode 4.6.
Any ideas? Thanks.

Related

EF Core Model Snapshot out of sync between add-migration and update

I'm using EF Core and code migrations. It's my understanding that the snapshot file is supposed to be the "target database" to build future migration files off of.
Situation:
1) I did an add-migration to create a migration after some changes. This updated the modelsnapshot which I guess is the expected behavior.
2) I then realized I realized I mis-typed one of my fields. Instead of a string it was supposed to be a byte[]
3) I made the changes to the classes
4) I did add-migration again.
Now the DataSnapshot seems to be out of sync because the new add-migration does not include this type file change.
It doesn't seem like I can do a remove-migration because no migration was actually applied to any database.
I know in EF6, this was a fine way to do it because it always targeted an actual database for the changes and not this snapshot file. So just deleting the change file and remaking the change file was good enough.
This is the second time I've had to make some change to a migration file after realizing there was an issue (without actually running the update against anything) and both times were just incredible pains to try to fix the issue without wiping out all my previous migrations and starting over.
My question is how do I handle this now? Should I be deleting both the change file and the snapshot file every time I do backtrack on an add migration?
I'm really concerned that I'm missing something here because now I have to make sure that not only is the change file correct but also the current snapshot is correct as well and if that snapshot ever goes out of sync, then I have to go and manually update it to
Probably have solved this by now, but I just ran into this.
Not sure if this is exactly the same issue, but this is how I understand it.
update-database is a DB action and updates your DB to current version or target migration.
remove-migration is an EF action and updates your migration stack and updates your snapshot.
To downversion I had to update database then remove migration down to the intended target.
At this point adding a new migration gave me the expected set of changes, where as before it was giving me none.
This appeared to do what I expected from EF doing update-database and update-database -target
The only thing I think you can actually do wrong in this case is delete your migration files before doing the update, because the down steps are indicated in the migration files, so it wont be able to complete this step if you remove the files. If you have the files, you can freely target migrations to set your current DB state.
I believe the confusing part is that the snapshot was previously used on every migration, where as now there's one snapshot for "last migration"

Which changes take precedence between updating commit message via git and updating diff vs editing revision in Phabricator?

I've noticed I can edit a Phabricator diff's summary field directly from the web app without having to update the git commit and then updating the diff, but it's not clear to me which changes take precedence. If I Edit Revision via the web app and later land the diff, will those changes get overwritten by the latest git commit message?
You can run arc amend to update the commit message locally based on what phabricator has recorded in differential. I think this is also ran before landing so it should update your local commit message if you change things in the web UI. I don't think the same is true in reverse, however. If you later update the commit message locally after submitting to differential, arc amend will overwrite your changes with the message from differential.

Git pull from heroku

How do I pull from heroku?
I have wordpress running in my heroku app and i changed some stuff via the template editor.
I'd like to have these changes also locally.
When i try to pull from heroku i get the message:
Already up-to-date.
But I don't have these changes locally
It's normal to get the Already up-to-date message, since the remote changes weren't commit and pushed.
Since you cannot commit and push from Heroku, you need work locally and then deploy. And that's how you should work at first place.
What did you change with the template editor? Probably configuration, and not code right? So if you do a pull from Heroku, you're not going to see changes? (I'm not familiar with wordpress - but I doubt the template changes result in code changes). So I guess I'm hypothesising that it's right: there are no changes.
Perhaps what you really want are database changes?
By the way, you can now clone a Heroku app with the new heroku git:clone
What does git branch -r --no-merged return? If it returns any branches, it means those branches have changes you don't have in the current branch yet. Merge them to get the changes.
Otherwise, the thing you are pulling does indeed not have any changes. That can mean that the changes you are looking for in another branch.
What you might want to do in that case is git fetch <heroku> where heroku is the name of the remote pointing to the heroku repository. That'll fetch all banches from heroku, which you then are able to merge.

cleartool update error in Solaris Unix

I am working on a view created from the main code repository on a Solaris server. I have modified a part of the code on my view and now I wish to update the code in my view to have the latest code from the repository. However when I do
cleartool update .
from the current directory to update all the files in the current directory, some(not all) of the files do not get updated and the message I get is
Keeping hijacked object <filePath> - base no longer known.
I am very sure that I have not modified the directory structure in my view nor has it been modified on the server repository. One hack that I discovered is to move the files that could not be updated to a different filename(essentially meaning that files with original filename no longer exist on my view) and then run the update command. But I do not want to work this out one by one for all the files. This also means I will have to perform the merge myself.
Has someone encountered this problem before? Any advice will be highly appreciated.
Thanks in advance.
You should try a "cleartool update -overwrite" (see cleartool update), as it should force the update of all files, hijacked or not.
But this message, according to the IBM technote swg1PK94061, is the result of:
When you rename a directory in a snapshot view, updating the view will cause files in the to become hijacked.
Problem conclusion
Closing this APAR as No Plans To Fix (NPTF) because:
(a) to the simple workaround of deleting the local copy of renamed directories which will mitigate the snapshot view update problem and
(b) because of this issue's low relative priority with higher impact defects
So simply delete (or move) the directory you have rename, relaunch you update, and said directory (and its updated content) will be restored.
Thanks for your comment VonC. I did check out the link you mentioned, but I did not find it much useful as I had not renamed any directory. After spending the whole day yesterday, I figured out that I had modified some of the files previously without checking them out first. This made me to modify them forecfully as they were in read-only mode as they were not checked-out. This resulted in those files to become hijacked, and hence when I tried to update my view to look at all the modifications in the repository, it was unable to merge my modified file with that on the server as those files were modified without being checked out so the cleartool update was made to believe that the file is not modified(since it was not checked out) but actually it was. That was the fuss!! :)

how to keep the iphone simulator application directory be the same when run it everytime

i met a problem with iphone simulator application directory, when i run the application everytime, the name of application directory was changed each of time,can anyone tell me how to keep a static application directory ?
i'm going to take a guess here and say..
you don't need a static directory.
I think what you need is to get the 'base directory' programatically.
NSString *docsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *path = [docsDirectory stringByAppendingPathComponent:#"fileName.txt"];
you should be saving your user files there (or somewhere similar)
or alternatively something like
NSBundle* bundle = [NSBundle mainBundle];
NSString* path = [bundle executablePath]
//or
NSString* path = [bundle resourcePath];
and then append your own paths onto that.
hope that helps.
NEW INFO:
If you are saving information, (a log, stats etc..) you can retrieve the files saved in the NSDocumentDirectory above using the Xcode organiser.
select your device
got the summary tab
find you application in 'Applications' section.
expand the entry and it should have an 'Applcation data' entry.
press the down arrow on the right to save your files.
If you simply relaunch the app from within the simulator springboard it will keep using the same directory. If you rebuild the app in Xcode it will move, and there is no way to prevent that. Xcode should migrate any data you have from the old directory to the new directory when it installs the new build.
I guess the problem is that XCode sometimes "loses" files.
So I lost all my preferences just now, and unable to get them back because XCode, once they are lost, can't recover them.
Here is what I did to resolve:
Open the console, note the directory it's using for the new launch, in my case that was
/Users/nik/Library/Application Support/iPhone Simulator/User/Applications/D713AFE6-D6B3-4D1E-A1B9-28FD679FD124/Documents/
Quit the app
Go to /Users/nik/Library/Application Support/iPhone Simulator/User/Applications and look for a launch that still has the preferences files in /Documents
Copy the preferences files to the last launch location above
Launch again - now it all worked. XCode created yet another temporary launch directory, but moved the files from the "last" launch over.
I am now also saving the preferences file in another location so next time this happens I have them handy.

Resources