Posts Tagged ‘mercurial’

Determine how much space is used by .git/.svn/.hg in a directory

Thursday, November 12th, 2015

Here’s a nasty little bash one-liner to determine how much space is being “wasted” but .svn/ or .git/ or .hg/ repos in your current directory:

du -k | sed -nE 's/^([0-9]*).*\.(svn|git|hg)$/\1/p' | awk '{s+=$1*1024} END {print s}' | awk '{ sum=$1 ; hum[1024**3]="Gb";hum[1024**2]="Mb";hum[1024]="Kb"; for (x=1024**3; x>=1024; x/=1024){ if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x];break } }}'

See who’s been checking in frequently to mercurial repository

Friday, December 13th, 2013

Here’s a bash snippet to show who’s been checking in code to a mercurial repository:

hg log | sed -n "s/user:  *//p" | sort | uniq -c | sort -rn

This prints something like:

 262 Pablo
 108 juanita
  23 carlos
  23 Maria Castano <>
  21 Juan Hernandez (
  17 psalamanca
  13 chico
   7 Maria Castano <>
   1 paco


Update: For an alternative measure try the churn extension.

hg pull error

Saturday, May 7th, 2011

I upgraded my mercurial using macports to version 1.8.3 and all of a sudden I got erros when trying to pull my current projects:

abort: error: _ssl.c:490: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

I tried adding the following to the project’s .hg/hgrc file:

cacerts =

This did not work.

Solution: Add the above to ~/.hgrc not your project’s hgrc.

This works, but now I get a bunch of nasty warnings every time I pull:

warning: certificate with fingerprint g2:3g:e5:8g:18:f9:g1:6g:gd:d7:3g:08:g0:bb:gb:dg:3a:g8:fg:gd not verified (check hostfingerprints or web.cacerts config setting)