# HG changeset patch # User mpm@selenic.com # Date 2005-05-12 09:23:26 # Node ID 022d98aa0a2ac6cea6e7702baafa26557bc9bd79 # Parent 1215bf60468f4f8bde16fa3a5c3d1d94b5732fae Fix tabs Update version number Set new merge as the default diff --git a/hg b/hg --- a/hg +++ b/hg @@ -1,7 +1,7 @@ #!/usr/bin/env python # # mercurial - a minimal scalable distributed SCM -# v0.4d "oedipa maas" +# v0.4e "sabina" # # Copyright 2005 Matt Mackall # @@ -147,11 +147,11 @@ elif cmd == "import" or cmd == "patch": ui.status("applying %s\n" % patch) pf = os.path.join(d, patch) - text = "" - for l in file(pf): + text = "" + for l in file(pf): if l[:3] == "---": break - text += l - + text += l + if os.system("patch -p%d < %s %s" % (strip, pf, quiet)): raise "patch failed!" f = os.popen("lsdiff --strip %d %s" % (strip, pf)) @@ -188,23 +188,13 @@ elif cmd == "export": elif cmd == "debugchangegroup": newer = repo.newer(map(repo.changelog.lookup, args)) - cg = repo.changegroup(newer) - sys.stdout.write(cg) + for chunk in repo.changegroup(newer): + sys.stdout.write(chunk) elif cmd == "debugaddchangegroup": data = sys.stdin.read() repo.addchangegroup(data) -elif cmd == "debuggetchangegroup": - if args: - other = hg.repository(ui, args[0]) - print "building changegroup" - cg = repo.getchangegroup(other) - print "applying changegroup" - repo.addchangegroup(cg) - else: - print "missing source repository" - elif cmd == "addremove": (c, a, d) = repo.diffdir(repo.root, repo.current) repo.add(a) @@ -283,6 +273,15 @@ elif cmd == "debugindex": elif cmd == "merge": if args: other = hg.repository(ui, args[0]) + print "retrieving changegroup" + cg = repo.getchangegroup(other) + repo.addchangegroup(cg) + else: + print "missing source repository" + +elif cmd == "debugoldmerge": + if args: + other = hg.repository(ui, args[0]) repo.merge(other) else: print "missing source repository"