Mercurial vs. me

Anything that isn't directly related to Age Creation but that might be interesting to Age developers.

Mercurial vs. me

Postby diafero » Sat May 08, 2010 3:02 am

Since some guys here decided that it's a great idea to host source code in mercurial, I hope to find some guys here who can help me with the issues triggered by that :lol: . To be honest, git was far easier to learn than hg, for me. For one of the most basic things to do when keeping local patches, a rebase, I had to create some config file to enable some extension... whatever, I got that working.

However, I am still having some issues with my local updater script: For git and git-svn, I wrote some simple commands that would show the latest remote commit (so that I can see whether I missed something) and my local commits on top of the latest remote commit (because I don't want to get too far away from master). For git-svn, it looks like this:
Code: Select all
git log git-svn^..git-svn --pretty=format:"Latest remote commit: %ad, by %an: %s" --date=local
git log HEAD...git-svn --pretty=format:"+ Locally added patch: %s" --date=local --reverse

Which was rather straight-forward after I figured out the formatting.

For hg, my code currently looks like this:
Code: Select all
    local=`hg outgoing -q -l1 --template {rev}`
    if [[ $local =~ [0-9]+ ]]; then
        hg log -r $(($local-1)) --template 'Latest remote commit: {date|date}, by {author}: {desc}\n'
        hg outgoing -q --template '+ Locally added patch: {desc}\n'
    else
        hg log -r tip --template 'Latest remote commit: {date|date}, by {author}: {desc}\n'
    fi
Which is much more complicated and pure guesswork... does anyone know an easier way to do that?


And the 2nd issue: After I figured out how to do the rebase, I wanted to get rid of the topmost commit (or, to be more precise, move tip one commit "down"). That would have been really simple with git: "git reset --hard HEAD^". I googled and tried for half an hour, but I absolutely couldn't figure it out. I ended up removing my local copy of the repo, checking it out again and applying only the patch I need, which can't really be the best way to do this. Anyone having some tips, please? :D
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2966
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Return to Off-Topic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests