##// END OF EJS Templates
qnew: ignore force option...
Augie Fackler -
r10372:27d542bc default
parent child Browse files
Show More
@@ -784,12 +784,11 b' class queue(object):'
784 784
785 785 def check_localchanges(self, repo, force=False, refresh=True):
786 786 m, a, r, d = repo.status()[:4]
787 if m or a or r or d:
788 if not force:
789 if refresh:
790 raise util.Abort(_("local changes found, refresh first"))
791 else:
792 raise util.Abort(_("local changes found"))
787 if (m or a or r or d) and not force:
788 if refresh:
789 raise util.Abort(_("local changes found, refresh first"))
790 else:
791 raise util.Abort(_("local changes found"))
793 792 return m, a, r, d
794 793
795 794 _reserved = ('series', 'status', 'guards')
@@ -804,7 +803,6 b' class queue(object):'
804 803 msg: a string or a no-argument function returning a string
805 804 """
806 805 msg = opts.get('msg')
807 force = opts.get('force')
808 806 user = opts.get('user')
809 807 date = opts.get('date')
810 808 if date:
@@ -821,12 +819,10 b' class queue(object):'
821 819 match.bad = badfn
822 820 m, a, r, d = repo.status(match=match)[:4]
823 821 else:
824 m, a, r, d = self.check_localchanges(repo, force)
822 m, a, r, d = self.check_localchanges(repo, force=True)
825 823 match = cmdutil.matchfiles(repo, m + a + r)
826 if force:
827 p = repo[None].parents()
828 if len(p) > 1:
829 raise util.Abort(_('cannot manage merge changesets'))
824 if len(repo[None].parents()) > 1:
825 raise util.Abort(_('cannot manage merge changesets'))
830 826 commitfiles = m + a + r
831 827 self.check_toppatch(repo)
832 828 insert = self.full_series_end()
@@ -2682,7 +2678,7 b' cmdtable = {'
2682 2678 "qnew":
2683 2679 (new,
2684 2680 [('e', 'edit', None, _('edit commit message')),
2685 ('f', 'force', None, _('import uncommitted changes into patch')),
2681 ('f', 'force', None, _('import uncommitted changes into patch (deprecated)')),
2686 2682 ('g', 'git', None, _('use git extended diff format')),
2687 2683 ('U', 'currentuser', None, _('add "From: <current user>" to patch')),
2688 2684 ('u', 'user', '', _('add "From: <given user>" to patch')),
@@ -23,11 +23,8 b' hg add somefile'
23 23 hg qnew uncommitted.patch
24 24 hg st
25 25 hg qseries
26 hg revert --no-backup somefile
27 rm somefile
28 26
29 27 echo '% qnew implies add'
30 hg qnew test.patch
31 28 hg -R .hg/patches st
32 29
33 30 echo '% qnew missing'
@@ -5,12 +5,11 b' abort: "status" cannot be used as the na'
5 5 abort: "guards" cannot be used as the name of a patch
6 6 abort: ".hgignore" cannot be used as the name of a patch
7 7 % qnew with uncommitted changes
8 abort: local changes found, refresh first
9 A somefile
8 uncommitted.patch
10 9 % qnew implies add
11 10 A .hgignore
12 11 A series
13 A test.patch
12 A uncommitted.patch
14 13 % qnew missing
15 14 abort: missing: No such file or directory
16 15 % qnew -m
@@ -22,7 +21,7 b' abort: patch "first.patch" already exist'
22 21 % qnew -f from a subdirectory
23 22 popping first.patch
24 23 popping mtest.patch
25 popping test.patch
24 popping uncommitted.patch
26 25 patch queue now empty
27 26 adding d/b
28 27 M d/b
General Comments 0
You need to be logged in to leave comments. Login now