pasithea: tankgirlesque (tech)
[personal profile] pasithea
Dear interwebs,

I have a workflow problem that it really seems like someone would have solved by now but I cannot find a clean solution.

Imagine 3 entities: The master repo (hereafter called MASTER), a machine where I build and run this code (we'll call it RUNNER) and a machine where I have an IDE but cannot run the code (IDE)

What I really want is just to run my IDE directly on RUNNER but because it's located elsewhere, I can't do that and trying to run Eclipse over X over ssh tunnels is full of suck.

Since I can't do that, the next best thing would be to keep the code on RUNNER and IDE reasonably in sync so that I can use IDE for browsing hierarchies and quick references to variables et al but still be able to run stuff on RUNNER and sometimes make quick ghetto changes on RUNNER and then port them back to IDE.

I _could_ simply do this with mercurial clones. We're using mercurial and it would work, it would just fill my changelogs with "Another Debug Change" messages and would make me sad.

I'd hoped mercurial queues would work but no such luck for this situation.

Apparently git allows you to change history pretty easily but mercurial doesn't and I don't want to convert to/from git for work.

My best solution at the moment sucks. I wrote a shell script that uses bidirectional rsync calls. It works but really somewhat defeats the purpose of version control.



#!/bin/bash
#Sync repos between desktop and remote machine

hgrc=".hg/hgrc"
path_depth=`pwd | sed 's/\// /g' | wc -w`
repo_url=""
project_dir=""

#Loop through path looking for mercurial repo.
#for i in { 2 .. $path_depth }
for (( i=2; i<=$path_depth; i++ ))
do
	project_dir=`pwd | cut -d "/" -f 1-5`
	filename=$project_dir/$hgrc
	if [ -f $filename ]
	then
		repo_url=`grep "^default" $filename | cut -d " " -f 3 | cut -d "/" -f 3- | sed 's/\/\//:\/\//g'`/
		break
	fi
done

if [ "$repo_url" != "" ]
then
	echo "Synching $project_dir $repo_url"
	cd $project_dir
	rsync -Lurp . $repo_url
	rsync -Lurp $repo_url .
else
	echo "No hg repository found in this path."
fi




Anyone got any better ideas? I'm open to suggestions and script improvements.

* Yes, I could break down and learn emacs. I could also immolate myself so spare me your emacy flames. I like Eclipse and I like vi. Deal with it.

February 2012

S M T W T F S
   1234
567891011
12 131415161718
19202122232425
26272829   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 17th, 2025 01:00 pm
Powered by Dreamwidth Studios