##// END OF EJS Templates
mq: fix qrefresh case sensitivity (issue3271)...
Durham Goode -
r17888:39b7052b stable
parent child Browse files
Show More
@@ -1575,8 +1575,18 b' class queue(object):'
1575 m = list(mm)
1575 m = list(mm)
1576 r = list(dd)
1576 r = list(dd)
1577 a = list(aa)
1577 a = list(aa)
1578 c = [filter(matchfn, l) for l in (m, a, r)]
1578
1579 match = scmutil.matchfiles(repo, set(c[0] + c[1] + c[2] + inclsubs))
1579 # create 'match' that includes the files to be recommited.
1580 # apply matchfn via repo.status to ensure correct case handling.
1581 cm, ca, cr, cd = repo.status(patchparent, match=matchfn)[:4]
1582 allmatches = set(cm + ca + cr + cd)
1583 refreshchanges = [x.intersection(allmatches) for x in (mm, aa, dd)]
1584
1585 files = set(inclsubs)
1586 for x in refreshchanges:
1587 files.update(x)
1588 match = scmutil.matchfiles(repo, files)
1589
1580 bmlist = repo[top].bookmarks()
1590 bmlist = repo[top].bookmarks()
1581
1591
1582 try:
1592 try:
@@ -1656,6 +1666,7 b' class queue(object):'
1656 n = newcommit(repo, oldphase, message, user, ph.date,
1666 n = newcommit(repo, oldphase, message, user, ph.date,
1657 match=match, force=True)
1667 match=match, force=True)
1658 # only write patch after a successful commit
1668 # only write patch after a successful commit
1669 c = [list(x) for x in refreshchanges]
1659 if inclsubs:
1670 if inclsubs:
1660 self.putsubstate2changes(substatestate, c)
1671 self.putsubstate2changes(substatestate, c)
1661 chunks = patchmod.diff(repo, patchparent,
1672 chunks = patchmod.diff(repo, patchparent,
@@ -160,4 +160,15 b' case changes.'
160 $ hg status -A
160 $ hg status -A
161 C MiXeDcAsE
161 C MiXeDcAsE
162
162
163 $ hg qpop -a
164 popping refresh-casechange
165 patch queue now empty
166 $ hg qnew refresh-pattern
167 $ hg status
168 $ echo A > A
169 $ hg add
170 adding A
171 $ hg qrefresh a # issue 3271, qrefresh with file handled case wrong
172 $ hg status # empty status means the qrefresh worked
173
163 $ cd ..
174 $ cd ..
@@ -208,6 +208,7 b' qrefresh --short tests:'
208 $ echo 'orphan' > orphanchild
208 $ echo 'orphan' > orphanchild
209 $ hg add orphanchild
209 $ hg add orphanchild
210 $ hg qrefresh nonexistentfilename # clear patch
210 $ hg qrefresh nonexistentfilename # clear patch
211 nonexistentfilename: No such file or directory
211 $ hg qrefresh --short 1/base
212 $ hg qrefresh --short 1/base
212 $ hg qrefresh --short 2/base
213 $ hg qrefresh --short 2/base
213
214
General Comments 0
You need to be logged in to leave comments. Login now