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