##// END OF EJS Templates
mq: avoid qnew committing everything on invalid paths (issue 803)...
Patrick Mezard -
r5534:61c230f8 default
parent child Browse files
Show More
@@ -610,15 +610,14 b' class queue:'
610 610 m, a, r, d = repo.status(files=fns, match=match)[:4]
611 611 else:
612 612 m, a, r, d = self.check_localchanges(repo, force)
613 fns, match, anypats = cmdutil.matchpats(repo, m + a + r)
613 614 commitfiles = m + a + r
614 615 self.check_toppatch(repo)
615 616 wlock = repo.wlock()
616 617 try:
617 618 insert = self.full_series_end()
618 if msg:
619 n = repo.commit(commitfiles, msg, force=True)
620 else:
621 n = repo.commit(commitfiles, "[mq]: %s" % patch, force=True)
619 commitmsg = msg and msg or ("[mq]: %s" % patch)
620 n = repo.commit(commitfiles, commitmsg, match=match, force=True)
622 621 if n == None:
623 622 raise util.Abort(_("repo commit failed"))
624 623 self.full_series[insert:insert] = [patch]
@@ -84,6 +84,27 b' cd ..'
84 84
85 85 cd a
86 86
87 echo a > somefile
88 hg add somefile
89
90 echo % qnew with uncommitted changes
91
92 hg qnew uncommitted.patch
93 hg st
94 hg qseries
95
96 echo '% qnew with uncommitted changes and missing file (issue 803)'
97
98 hg qnew issue803.patch someotherfile 2>&1 | \
99 sed -e 's/someotherfile:.*/someotherfile: No such file or directory/'
100 hg st
101 hg qseries
102 hg qpop -f
103 hg qdel issue803.patch
104
105 hg revert --no-backup somefile
106 rm somefile
107
87 108 echo % qnew -m
88 109
89 110 hg qnew -m 'foo bar' test.patch
@@ -83,6 +83,14 b' bleh'
83 83 series:
84 84 A
85 85 B
86 % qnew with uncommitted changes
87 abort: local changes found, refresh first
88 A somefile
89 % qnew with uncommitted changes and missing file (issue 803)
90 someotherfile: No such file or directory
91 A somefile
92 issue803.patch
93 Patch queue now empty
86 94 % qnew -m
87 95 foo bar
88 96 % qrefresh
General Comments 0
You need to be logged in to leave comments. Login now