I checked out the codebase on my desktop computer and worked some on it. Now Im going away and want those changes on my laptop.
One solution is to simply commit the incomplete code and then pull them on my laptop. But that would then mean that I have uncompiling code in the repos, something I would like to avoid.
Whats the best way to handle this? Generate and apply a patch? Using hg serve to move the incomplete change?
Here are three ways to do this. I’ll discuss the pros and cons of each:
Option 1: use
hg diffto get a diff file showing the uncommited changes, and thenhg import --nocommiton the receiving end to apply those changes without creating a new changesetOption 2: Commit on the sending side, push to the receiving end (or pull from it, or put a
hg bundleon a flash drive), bypassing the work server,updateon the receiving side, and thenhg rollbackon both sides to eliminate the changeset (but leave the changes.Option 3: Commit on the sending side. Push to a developer-repo that only you access, and Pull on the receiving end. Don’t push to the company repo until things build, but when you do push push all the interstitial changesets
FWIW, I recommend option 3. Per-developer repositories are exactly what DVCSs are about. If your company doesn’t make it easy to set one up on a server you can access from home and away, point out to them the immense value in having documented the process that got a developer to a completed fix/feature and that encouraging developers to push to a not-required-to-compile repo frequently is good for daily backups.
Lastly, after you’re done with your feature or fix you can always collapse-away all the intermediary changesets. I don’t like do it (I’m a show your work kind of guy), but here’s how: Can I squash commits in Mercurial?