comparison hgext/mq.py @ 4174:7307d2e98b32

fix qrefresh'ing an empty patch This is not superefficient (the commit will have to walk the whole tree), but it works.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 10 Mar 2007 22:03:23 -0300
parents 1df1baf2002e
children ba51a8225a60 ce6c364ebb2a
comparison
equal deleted inserted replaced
4173:b36bd7534c08 4174:7307d2e98b32
1013 dd.append(x) 1013 dd.append(x)
1014 1014
1015 m = util.unique(mm) 1015 m = util.unique(mm)
1016 r = util.unique(dd) 1016 r = util.unique(dd)
1017 a = util.unique(aa) 1017 a = util.unique(aa)
1018 filelist = filter(matchfn, util.unique(m + r + a)) 1018 c = [filter(matchfn, l) for l in (m, a, r, [], u)]
1019 filelist = util.unique(c[0] + c[1] + c[2])
1019 patch.diff(repo, patchparent, files=filelist, match=matchfn, 1020 patch.diff(repo, patchparent, files=filelist, match=matchfn,
1020 fp=patchf, changes=(m, a, r, [], u), 1021 fp=patchf, changes=c, opts=self.diffopts())
1021 opts=self.diffopts())
1022 patchf.close() 1022 patchf.close()
1023 1023
1024 repo.dirstate.setparents(*cparents) 1024 repo.dirstate.setparents(*cparents)
1025 copies = {} 1025 copies = {}
1026 for dst in a: 1026 for dst in a:
1064 message = "\n".join(message) 1064 message = "\n".join(message)
1065 else: 1065 else:
1066 message = msg 1066 message = msg
1067 1067
1068 self.strip(repo, top, update=False, backup='strip', wlock=wlock) 1068 self.strip(repo, top, update=False, backup='strip', wlock=wlock)
1069 n = repo.commit(filelist, message, changes[1], force=1, wlock=wlock) 1069 n = repo.commit(filelist, message, changes[1], match=matchfn,
1070 force=1, wlock=wlock)
1070 self.applied[-1] = statusentry(revlog.hex(n), patchfn) 1071 self.applied[-1] = statusentry(revlog.hex(n), patchfn)
1071 self.applied_dirty = 1 1072 self.applied_dirty = 1
1072 else: 1073 else:
1073 self.printdiff(repo, patchparent, fp=patchf) 1074 self.printdiff(repo, patchparent, fp=patchf)
1074 patchf.close() 1075 patchf.close()