hgext/convert/convcmd.py
changeset 5934 e495f3f35b2d
parent 5621 badbefa55972
child 5959 0162c6cc045e
child 6099 37cc79a5727a
equal deleted inserted replaced
5920:5df7cb799baf 5934:e495f3f35b2d
   220             else:
   220             else:
   221                 dest = self.map[changes]
   221                 dest = self.map[changes]
   222             self.mapentry(rev, dest)
   222             self.mapentry(rev, dest)
   223             return
   223             return
   224         files, copies = changes
   224         files, copies = changes
   225         parents = [self.map[r] for r in commit.parents]
   225         pbranches = []
   226         if commit.parents:
   226         if commit.parents:
   227             prev = commit.parents[0]
   227             for prev in commit.parents:
   228             if prev not in self.commitcache:
   228                 if prev not in self.commitcache:
   229                 self.cachecommit(prev)
   229                     self.cachecommit(prev)
   230             pbranch = self.commitcache[prev].branch
   230                 pbranches.append((self.map[prev], 
   231         else:
   231                                   self.commitcache[prev].branch))
   232             pbranch = None
   232         self.dest.setbranch(commit.branch, pbranches)
   233         self.dest.setbranch(commit.branch, pbranch, parents)
       
   234         for f, v in files:
   233         for f, v in files:
   235             filenames.append(f)
   234             filenames.append(f)
   236             try:
   235             try:
   237                 data = self.source.getfile(f, v)
   236                 data = self.source.getfile(f, v)
   238             except IOError, inst:
   237             except IOError, inst:
   244                     if f in copies:
   243                     if f in copies:
   245                         copyf = copies[f]
   244                         copyf = copies[f]
   246                         # Merely marks that a copy happened.
   245                         # Merely marks that a copy happened.
   247                         self.dest.copyfile(copyf, f)
   246                         self.dest.copyfile(copyf, f)
   248 
   247 
       
   248         parents = [b[0] for b in pbranches]
   249         newnode = self.dest.putcommit(filenames, parents, commit)
   249         newnode = self.dest.putcommit(filenames, parents, commit)
   250         self.mapentry(rev, newnode)
   250         self.mapentry(rev, newnode)
   251 
   251 
   252     def convert(self):
   252     def convert(self):
   253         try:
   253         try: