Mercurial > hgsubversion
comparison hgsubversion/utility_commands.py @ 550:f0159775e0f1
utility_commands: fix hg svn genignore for single-directory mode
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Sat, 06 Feb 2010 11:13:55 -0600 |
parents | b97f5734e5a8 |
children | 00393e9abff8 |
comparison
equal
deleted
inserted
replaced
549:b97f5734e5a8 | 550:f0159775e0f1 |
---|---|
15 svn = svnrepo.svnremoterepo(repo.ui).svn | 15 svn = svnrepo.svnremoterepo(repo.ui).svn |
16 meta = repo.svnmeta() | 16 meta = repo.svnmeta() |
17 hashes = meta.revmap.hashes() | 17 hashes = meta.revmap.hashes() |
18 parent = util.parentrev(ui, repo, meta, hashes) | 18 parent = util.parentrev(ui, repo, meta, hashes) |
19 r, br = hashes[parent.node()] | 19 r, br = hashes[parent.node()] |
20 branchpath = br and ('branches/%s' % br) or 'trunk' | 20 if meta.layout == 'single': |
21 branchpath = '' | |
22 else: | |
23 branchpath = br and ('branches/%s/' % br) or 'trunk/' | |
21 ignorelines = ['.hgignore', 'syntax:glob'] | 24 ignorelines = ['.hgignore', 'syntax:glob'] |
22 dirs = [''] + [d[0] for d in svn.list_files(branchpath, r) | 25 dirs = [''] + [d[0] for d in svn.list_files(branchpath, r) |
23 if d[1] == 'd'] | 26 if d[1] == 'd'] |
24 for dir in dirs: | 27 for dir in dirs: |
25 props = svn.list_props('%s/%s/' % (branchpath, dir), r) | 28 path = '%s%s' % (branchpath, dir) |
29 props = svn.list_props(path, r) | |
26 if 'svn:ignore' not in props: | 30 if 'svn:ignore' not in props: |
27 continue | 31 continue |
28 lines = props['svn:ignore'].strip().split('\n') | 32 lines = props['svn:ignore'].strip().split('\n') |
29 ignorelines += [dir and (dir + '/' + prop) or prop for prop in lines] | 33 ignorelines += [dir and (dir + '/' + prop) or prop for prop in lines] |
30 | 34 |