[cig-commits] commit: test-forest tests now pass.
Mercurial
hg at geodynamics.org
Mon Nov 24 11:27:06 PST 2008
changeset: 52:504a07390de3
user: Simon Law <simon at akoha.org>
date: Tue Jul 10 12:20:52 2007 -0400
files: forest.py
description:
test-forest tests now pass.
diff -r d3d1b4a1a90d -r 504a07390de3 forest.py
--- a/forest.py Tue Jul 10 10:20:14 2007 -0400
+++ b/forest.py Tue Jul 10 12:20:52 2007 -0400
@@ -244,10 +244,12 @@ def tree_sections(cfg, withtop=True):
def mq_patches_applied(rpath):
- if rpath.startswith("file:"):
+ if rpath.startswith("ssh:"):
+ raise util.Abort(_("'%s' starts with ssh:") % rpath)
+ elif rpath.startswith("http:"):
+ raise util.Abort(_("'%s' starts with http:") % rpath)
+ elif rpath.startswith("file:"):
rpath = rpath[len("file:"):]
- else:
- raise util.Abort(_("'%s' does not start with file:") % rpath)
rpath = os.path.join(rpath, ".hg")
entries = os.listdir(rpath)
for e in entries:
@@ -348,6 +350,8 @@ class ForestSnapshot(object):
rootmap = {}
self.trees = []
top = repo.url()
+ if hasattr(repo, "root"):
+ top = repo.root
for f in repo.forests(walkhg):
relpath = util.pconvert(f)
if f == ".":
@@ -356,7 +360,7 @@ class ForestSnapshot(object):
if relpath != '.':
repo = hg.repository(ui, abspath)
if mq_fatal and mq_patches_applied(abspath):
- raise util.Abort(_("'%s' has mq patches applied") % abspath)
+ raise util.Abort(_("'%s' has mq patches applied") % relpath)
if tip:
rev = 'tip'
else:
@@ -394,11 +398,15 @@ def clone(ui, source, dest, walkhg, **op
if not os.path.exists(destpfx):
os.makedirs(destpfx)
opts['rev'] = [rev]
- commands.clone(ui, repo.url(), destpath, **opts)
+ url = repo.url()
+ if hasattr(repo, "root"):
+ url = repo.root
+ commands.clone(ui, url, destpath, **opts)
snapshot = ForestSnapshot()
repo = hg.repository(ui, source)
- snapshot.update(ui, repo, False, walkhgenabled(ui, walkhg), True)
+ snapshot.update(ui, repo, isinstance(repo, localrepo.localrepository),
+ walkhgenabled(ui, walkhg), True)
snapshot(ui, repo, doit, mq_check=False)
@@ -509,13 +517,10 @@ def trees(ui, repo, convert=False, walkh
walkhg = walkhgenabled(ui, walkhg)
if convert:
- pfxlen = len(repo.root + os.sep)
- l = [util.pconvert(p[pfxlen:])
- for p in repo.forests(walkhg)]
- l.remove('')
- l.insert(0, '.')
+ l = repo.forests(walkhg)
else:
- l = repo.forests(walkhg)
+ root = repo.root
+ l = [os.sep.join(root, f) for f in repo.forests(walkhg)]
for t in l:
ui.write(t + '\n')
More information about the CIG-COMMITS
mailing list