A simple extension to the hg (mercurial) forest (fdiff fcommit and fimport)

For Sun WebStack, I have been working with multiple repositories (apache2, squid, mysql5, lighttpd etc). I often have to do the same or related changes in each of these repositories.The standard commands that I had to use to work with these repos are,

  • Fetch the sources for all repos [ for i in $mylist; do hg clone ssh://webstack-root/$i ; done ]
  • Fix some stuff and verify by doing a diff [ for i in \*; do [ -d $i/.hg ] && (cd $i && hg diff ); done]
  • Commit the fixes [for i in \* ; do [ -d $i/.hg ] && (cd $i && hg commit -m "my message" ) ; done ]
  • And push the same way. [for i in \* ; do [ -d $i/.hg ] && (cd $i && hg push) ; done]

Quite recently I found the forest extension which allowed me to do
- on top dir in the server
hg init
- on the client systems, clone, push and pull
hg fclone ssh://webstack-root
hg fpull
hg up

hg fpush

These were very helpful, but I also wanted to review the diffs (and to request for review) and to commit related changes with the same aggregated commit message, Unfortunately the forest extension does not yet have commands for these.

I have modified the forest extension slightly to provide for new commands 'fdiff'  'fcommit' and 'fimport'. The source is here. In case you have the same need, drop this into your hgext directory (replace the forest.py if it exists) or set the extension path in your .hgrc

Beware that this is nothing more than a hack though.

Edit: added fimport

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

blue

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today