hgext/convert/cvs.py
changeset 6077 fb259a3572e9
parent 5921 549a7ebe1607
child 6318 308988071b90
equal deleted inserted replaced
6076:0ee885fea464 6077:fb259a3572e9
    69                         self.parent[id] = self.lastbranch.get(branch, 'bad')
    69                         self.parent[id] = self.lastbranch.get(branch, 'bad')
    70                         self.lastbranch[branch] = id
    70                         self.lastbranch[branch] = id
    71                     elif l.startswith("Ancestor branch"):
    71                     elif l.startswith("Ancestor branch"):
    72                         ancestor = l[17:-1]
    72                         ancestor = l[17:-1]
    73                         # figure out the parent later
    73                         # figure out the parent later
    74                         self.parent[id] = None
    74                         self.parent[id] = self.lastbranch[ancestor]
    75                     elif l.startswith("Author"):
    75                     elif l.startswith("Author"):
    76                         author = self.recode(l[8:-1])
    76                         author = self.recode(l[8:-1])
    77                     elif l.startswith("Tag:") or l.startswith("Tags:"):
    77                     elif l.startswith("Tag:") or l.startswith("Tags:"):
    78                         t = l[l.index(':')+1:]
    78                         t = l[l.index(':')+1:]
    79                         t = [ut.strip() for ut in t.split(',')]
    79                         t = [ut.strip() for ut in t.split(',')]
    99                         p = [self.parent[id]]
    99                         p = [self.parent[id]]
   100                         if id == "1":
   100                         if id == "1":
   101                             p = []
   101                             p = []
   102                         if branch == "HEAD":
   102                         if branch == "HEAD":
   103                             branch = ""
   103                             branch = ""
   104                         if branch and p[0] == None:
   104                         if branch:
   105                             latest = None
   105                             latest = None
   106                             # the last changeset that contains a base
   106                             # the last changeset that contains a base
   107                             # file is our parent
   107                             # file is our parent
   108                             for r in oldrevs:
   108                             for r in oldrevs:
   109                                 latest = max(filerevids[r], latest)
   109                                 latest = max(filerevids.get(r, None), latest)
   110                             p = [latest]
   110                             if latest:
       
   111                                 p = [latest]
   111 
   112 
   112                         # add current commit to set
   113                         # add current commit to set
   113                         c = commit(author=author, date=date, parents=p,
   114                         c = commit(author=author, date=date, parents=p,
   114                                    desc=log, branch=branch)
   115                                    desc=log, branch=branch)
   115                         self.changeset[id] = c
   116                         self.changeset[id] = c