Mercurial > hg > pyhgsh
comparison hg @ 46:93e868fa0db8
Add changegroup support
author | mpm@selenic.com |
---|---|
date | Tue, 10 May 2005 00:40:49 -0800 |
parents | adf70fffca9f |
children | 14bff5d8e526 |
comparison
equal
deleted
inserted
replaced
45:f2b2d5daec30 | 46:93e868fa0db8 |
---|---|
6 # Copyright 2005 Matt Mackall <mpm@selenic.com> | 6 # Copyright 2005 Matt Mackall <mpm@selenic.com> |
7 # | 7 # |
8 # This software may be used and distributed according to the terms | 8 # This software may be used and distributed according to the terms |
9 # of the GNU General Public License, incorporated herein by reference. | 9 # of the GNU General Public License, incorporated herein by reference. |
10 | 10 |
11 # the psyco compiler makes commits about twice as fast | 11 # the psyco compiler makes commits a bit faster |
12 try: | 12 # and makes changegroup merge about 20 times slower! |
13 import psyco | 13 # try: |
14 psyco.full() | 14 # import psyco |
15 except: | 15 # psyco.full() |
16 pass | 16 # except: |
17 # pass | |
17 | 18 |
18 import sys, os, time | 19 import sys, os, time |
19 from mercurial import hg, mdiff, fancyopts | 20 from mercurial import hg, mdiff, fancyopts |
20 | 21 |
21 def help(): | 22 def help(): |
172 | 173 |
173 elif cmd == "export": | 174 elif cmd == "export": |
174 node = repo.changelog.lookup(args[0]) | 175 node = repo.changelog.lookup(args[0]) |
175 prev = repo.changelog.parents(node)[0] | 176 prev = repo.changelog.parents(node)[0] |
176 diff(None, prev, node) | 177 diff(None, prev, node) |
178 | |
179 elif cmd == "debugchangegroup": | |
180 newer = repo.newer(repo.changelog.lookup(args[0])) | |
181 cg = repo.changegroup(newer) | |
182 sys.stdout.write(cg) | |
183 | |
184 elif cmd == "debugaddchangegroup": | |
185 data = sys.stdin.read() | |
186 repo.addchangegroup(data) | |
177 | 187 |
178 elif cmd == "addremove": | 188 elif cmd == "addremove": |
179 (c, a, d) = repo.diffdir(repo.root, repo.current) | 189 (c, a, d) = repo.diffdir(repo.root, repo.current) |
180 repo.add(a) | 190 repo.add(a) |
181 repo.remove(d) | 191 repo.remove(d) |