So I’ve been editing my code in browser, saving changes along the way. Then I opened another submodule in another browser window, so I can have code side by side. Somehow (I guess) I happened to edit the same code and I got a prompt (revering back to the latest version). This caused all of my changes to get lost (very not happy about that).
So my first question: can I find the changes I made? The “View History” is not extensive and hence not helpful.
Second questions: My code is at this point large enough that I don’t want to deal with browser as editor. What is recommend way to set up external IDE? I prefer PyCharm and can clone the code easy there but how can I sync the code the other way (heard about the Uplink but not sure if that’s the only thing I need to know).
I can’t help on the first part, but …
Most people here talk about using GIT to clone and push changes. If you search you’ll find posts on that subject.
Purely subjectively, I’m experimenting with putting all my server code on a private server (Digital Ocean) and using uplink. The advantage is I can use pycharm/vscode, but the major disadvantage I’ve found so far is that I lose a lot of the autocomplete features for the anvil libraries.
So not a recommendation of either technique, but the uplink way does look quite good at the moment.
1 Like
Actually, using Anvil’s git
integration can also help with your first question. Here’s how.
Once you’ve used that integration to get a local copy of the application source code, you actually have more than just the latest copy. You also have a copy of the entire sequence of changes to the source, as a local (on-your-PC) git
repository.
git
includes tools that let you browse that history, and pick out parts of interest for viewing or copying. Add-on tools can make this task even easier and more understandable.
2 Likes
Yikes! I’m sorry – losing changes on conflict is something Anvil should never do! How much did you lose? The system should track which version you’re editing, and which browser window is up to date, then detect any conflict if the “older” window tries to edit after the “newer” window.
Are you able (with a dummy application, I’d suggest!) to replicate a sequence of edits that causes you to lose work? If you can replicate the bug, we can fix it!
Also, if you can send your app ID and the time-frame involved (ie when you’d like to recover the app to) to support@anvil.works, I’ll see if there’s anything left in the caches.
(As for the “View History” dialog - that saves changes when you stop editing for 15 minutes, or when you click “Save Version” [or a couple of things, like any git operation]. I’m afraid it’s not so useful at moments like this. If you’re worried, you can use Save Version a little more often.)
Holy cow of course I can push. Only when you have a solution my question looks so dumb.
This is super helpful @p.colbert! I don’t see all of the local changes that I made so they seem to have gone, but I’ll live.
@meredydd All I know is that I had two windows open, somehow got a message (that I now forgot) about the reverting to the latest version. I was pretty sure changes were saved along the way but I guess I was wrong.
Anyway, not a big deal, it was a dozen or so lines of code. It’ll be fine.
Appreciate the help!
FYI, I got this right before the changes were deleted (I’m seeing it again for the different project):
