comparison hgext/mq.py @ 4182:ba51a8225a60

Merge with crew-stable
author Brendan Cully <brendan@kublai.com>
date Sat, 10 Mar 2007 17:45:32 -0800
parents 9dc64c8414ca 7307d2e98b32
children 65aabd9f16f0
comparison
equal deleted inserted replaced
4181:ac9e891f2c0f 4182:ba51a8225a60
1029 dd.append(x) 1029 dd.append(x)
1030 1030
1031 m = util.unique(mm) 1031 m = util.unique(mm)
1032 r = util.unique(dd) 1032 r = util.unique(dd)
1033 a = util.unique(aa) 1033 a = util.unique(aa)
1034 filelist = filter(matchfn, util.unique(m + r + a)) 1034 c = [filter(matchfn, l) for l in (m, a, r, [], u)]
1035 filelist = util.unique(c[0] + c[1] + c[2])
1035 patch.diff(repo, patchparent, files=filelist, match=matchfn, 1036 patch.diff(repo, patchparent, files=filelist, match=matchfn,
1036 fp=patchf, changes=(m, a, r, [], u), 1037 fp=patchf, changes=c, opts=self.diffopts())
1037 opts=self.diffopts())
1038 patchf.close() 1038 patchf.close()
1039 1039
1040 repo.dirstate.setparents(*cparents) 1040 repo.dirstate.setparents(*cparents)
1041 copies = {} 1041 copies = {}
1042 for dst in a: 1042 for dst in a:
1080 message = "\n".join(message) 1080 message = "\n".join(message)
1081 else: 1081 else:
1082 message = msg 1082 message = msg
1083 1083
1084 self.strip(repo, top, update=False, backup='strip', wlock=wlock) 1084 self.strip(repo, top, update=False, backup='strip', wlock=wlock)
1085 n = repo.commit(filelist, message, changes[1], force=1, wlock=wlock) 1085 n = repo.commit(filelist, message, changes[1], match=matchfn,
1086 force=1, wlock=wlock)
1086 self.applied[-1] = statusentry(revlog.hex(n), patchfn) 1087 self.applied[-1] = statusentry(revlog.hex(n), patchfn)
1087 self.applied_dirty = 1 1088 self.applied_dirty = 1
1088 else: 1089 else:
1089 self.printdiff(repo, patchparent, fp=patchf) 1090 self.printdiff(repo, patchparent, fp=patchf)
1090 patchf.close() 1091 patchf.close()
1525 qbase, destrev = None, None 1526 qbase, destrev = None, None
1526 if sr.local(): 1527 if sr.local():
1527 if sr.mq.applied: 1528 if sr.mq.applied:
1528 qbase = revlog.bin(sr.mq.applied[0].rev) 1529 qbase = revlog.bin(sr.mq.applied[0].rev)
1529 if not hg.islocal(dest): 1530 if not hg.islocal(dest):
1530 destrev = sr.parents(qbase)[0] 1531 heads = dict.fromkeys(sr.heads())
1532 for h in sr.heads(qbase):
1533 del heads[h]
1534 destrev = heads.keys()
1535 destrev.append(sr.changelog.parents(qbase)[0])
1531 ui.note(_('cloning main repo\n')) 1536 ui.note(_('cloning main repo\n'))
1532 sr, dr = hg.clone(ui, sr, dest, 1537 sr, dr = hg.clone(ui, sr, dest,
1533 pull=opts['pull'], 1538 pull=opts['pull'],
1534 rev=destrev, 1539 rev=destrev,
1535 update=False, 1540 update=False,