summaryrefslogtreecommitdiff
authorHelio Chissini de Castro <helio.chissini.de.castro@collabora.co.uk>2012-08-15 12:14:56 (GMT)
committer Helio Chissini de Castro <helio.chissini.de.castro@collabora.co.uk>2012-08-15 12:14:56 (GMT)
commit7d8c17d24ae90a18908101e70ff3d3be4ac1ba4c (patch) (side-by-side diff)
treef16f8e490c2747f7dce8a246765a7d107323ea18
parent73b45b382102ce94d228e85753ddc512ff73c9eb (diff)
downloadanagrman-7d8c17d24ae90a18908101e70ff3d3be4ac1ba4c.tar.gz
anagrman-7d8c17d24ae90a18908101e70ff3d3be4ac1ba4c.tar.bz2
Fixed empty entries when no defined revision/remote is declared
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xanagrman15
1 files changed, 10 insertions, 5 deletions
diff --git a/anagrman b/anagrman
index 1e7b184..a5137e8 100755
--- a/anagrman
+++ b/anagrman
@@ -79,9 +79,11 @@ class CGitPlainXMLParser:
if verbose:
print "Project " + name + " is present in one or more entries. Can go global."
projects[name] = {'revision':revision,'remote':fremote,'path':path}
- name = ''
- revision = ''
- fremote = ''
+ elif name:
+ projects[name] = {'path':path}
+ name = ''
+ revision = ''
+ fremote = ''
class XmlWriter:
def __init__(self):
@@ -115,10 +117,13 @@ def generateFinal():
for p in projects.keys():
newremote = ''
for r in remotes.keys():
- if projects[p]['remote'] in remotes[r]:
- newremote = remotes[r][0]
+ if projects[p].has_key('remote'):
+ if projects[p]['remote'] in remotes[r]:
+ newremote = remotes[r][0]
if newremote:
doc.createNode('project', node, withAttribs = {'path': projects[p]['path'], 'name': p, 'revision':projects[p]['revision'], 'remote':newremote } )
+ elif not projects[p].has_key('revision'):
+ doc.createNode('project', node, withAttribs = {'path': projects[p]['path'], 'name': p } )
else:
doc.createNode('project', node, withAttribs = {'path': projects[p]['path'], 'name': p, 'revision':projects[p]['revision'] } )
if verbose: