comparison mercurial/commands.py @ 1736:50de0887bbcd

add preoutgoing and outgoing hooks. preoutgoing lets prevent pull over http or ssh. outgoing lets notify after pull.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Fri, 17 Feb 2006 08:26:21 -0800
parents 9488d53233b5
children 57de7e1a81d2 f95654385065
comparison
equal deleted inserted replaced
1735:791405fe9991 1736:50de0887bbcd
620 """ 620 """
621 f = open(fname, "wb") 621 f = open(fname, "wb")
622 dest = ui.expandpath(dest, repo.root) 622 dest = ui.expandpath(dest, repo.root)
623 other = hg.repository(ui, dest) 623 other = hg.repository(ui, dest)
624 o = repo.findoutgoing(other) 624 o = repo.findoutgoing(other)
625 cg = repo.changegroup(o) 625 cg = repo.changegroup(o, 'bundle')
626 626
627 try: 627 try:
628 f.write("HG10") 628 f.write("HG10")
629 z = bz2.BZ2Compressor(9) 629 z = bz2.BZ2Compressor(9)
630 while 1: 630 while 1:
1997 elif cmd == "changegroup": 1997 elif cmd == "changegroup":
1998 nodes = [] 1998 nodes = []
1999 arg, roots = getarg() 1999 arg, roots = getarg()
2000 nodes = map(bin, roots.split(" ")) 2000 nodes = map(bin, roots.split(" "))
2001 2001
2002 cg = repo.changegroup(nodes) 2002 cg = repo.changegroup(nodes, 'serve')
2003 while 1: 2003 while 1:
2004 d = cg.read(4096) 2004 d = cg.read(4096)
2005 if not d: 2005 if not d:
2006 break 2006 break
2007 fout.write(d) 2007 fout.write(d)