[physfs] My shot at PHYSFS_stat

Ryan C. Gordon icculus at icculus.org
Tue Feb 16 20:52:16 EST 2010

> Perhaps you can help me with a short step list. I have a branch ErrorCode
> i am working on and a default branch. Now i would like to throw away my
> default branch and take yours again. How would you do this with mercurial? 

Here's the short version, followed by the long explanation.

  cd /where/my/working/copy/resides
  hg pull
  hg update default
  hg pull http://hg.icculus.org/icculus/physfs/
  HGMERGE='sh -c "cp \$2 \$0"' hg merge
  hg commit
  hg push

The long explanation...

I cloned my working copy, experimented, deleted it, and recloned like 18 
times writing this. There's a sort of permanence to mistakes you make in 
Mercurial, so I wanted to get it right on a clean copy. You can clone 
your working directory the same as a URL:

   hg clone current-directory-name new-directory-name

...just don't push until you're comfortable with the results.

Normally merging two trees involves Mercurial automatically merging the 
differences that aren't near each other (since it's usually two 
unrelated people fixing two unrelated things in the same file, or only 
one of those two people touched a given file, etc), and then someone 
manually cleaning up the places where there was overlap, usually using a 
merge tool with a nice GUI.

In this case, though, damned near all our changes are going to conflict, 
and you just want to throw away your changes in favor of mine, so we'll 
tell Mercurial that the merge tool is "cp."  :)

In your working copy, make sure you have the latest from your repo, in 
case you jump between workstations as much as I do...

  hg pull
  hg update default

...then pull the latest from my repo:

  hg pull http://hg.icculus.org/icculus/physfs/

...mercurial will say...

pulling from http://hg.icculus.org/icculus/physfs/
searching for changes
adding changesets
adding manifests
adding file changes
added 28 changesets with 87 changes to 27 files (+1 heads)

...then do the "merge" which in this case is "take Ryan's changes no 
matter what"...

   HGMERGE='sh -c "cp \$2 \$0"' hg merge

...do an "hg diff" here if you want to sanity check the merge. Then 
commit the merge and publish it...

   hg commit
   hg push

...now your default branch looks like mine, and your ErrorCode branch is 
  left as it was. If you like, you can merge these changes across to the 
ErrorCode branch as well, but I would consider using a real merge tool 
for that, in case there are conflicts that could go either way.

Also: please make sure you have an .hgrc file in your home directory 
with at least your username:

username = My Full Name <user at example.com>

...as this is what gets associated with your commits.


More information about the physfs mailing list