mq: alter location of "status" file

Hermann Lauer Hermann.Lauer at iwr.uni-heidelberg.de
Thu Jan 7 15:11:36 UTC 2010


On Thu, Jan 07, 2010 at 12:42:04PM +0100, Dirkjan Ochtman wrote:
> If you use qinit -c and qcommit to initialize the patch queue as a
> repository of it's own, it will know not to add status, so you can
> easily share patch queues that way (and many people do so).

At the moment I'm linking in (ln -s) the patches directory into a
build directory structure unpacked from a source where a (tiny) .hg 
is only setup with the files which are to be patched. Those are read 
out from the patches in the patches directory via lsdiff and added 
automatically to the repo (current script is attached).

As the patches are the only thing I'm interested I can rm -r the
buildstructure and start over at any point, as all the patches
live outside of the build stuff. The only thing which didn't
belong to the outside is the status file - as this contains information
from the temporary .hg setup. Using your proposed approach (tried that)
I must remember to push out things of the temporary buildstructure
after the build finishes.
That's what I like to avoid.

Would simply setting self.status_path = "../mqstatus" in mq.py
have some undesired side effects ?

Thanks, also for your working on mercurial,
 Hermann

-- 
Netzwerkadministration/Zentrale Dienste, Interdiziplinaeres 
Zentrum fuer wissenschaftliches Rechnen der Universitaet Heidelberg
IWR; INF 368; 69120 Heidelberg; Tel: (06221)54-8236 Fax: -5224
Email: Hermann.Lauer at iwr.uni-heidelberg.de
-------------- next part --------------
#!/usr/bin/python

import sys,os,subprocess

def init():
  subprocess.call(["hg","init"])

  f=file(".hgignore","a")
  f.write(".*\n")
  f.close()

  basename=os.path.basename(os.getcwd()).split("-")[0]
  lnk="../../patches"
  sys.stdout.write("linking to %s\n"%lnk)
  subprocess.call(["ln","-s",lnk,".hg/patches"])

  global out
  out=subprocess.Popen("lsdiff --strip=1 -h .hg/patches/*",shell=True,stdout=subprocess.PIPE).communicate()[0]
  print out

  files=out.split()
  subprocess.call(["hg","add"]+files)
  subprocess.call(["hg","ci","-m","auto patch added"])


init()


More information about the Mercurial mailing list