Show More
@@ -784,8 +784,7 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: |
|
|||
789 |
|
|
788 | if refresh: | |
790 |
|
|
789 | raise util.Abort(_("local changes found, refresh first")) | |
791 |
|
|
790 | else: | |
@@ -804,7 +803,6 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,11 +819,9 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() |
|
|||
828 | if len(p) > 1: |
|
|||
829 |
|
|
825 | 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) | |
@@ -2682,7 +2678,7 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 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 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 |
|
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 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 |
|
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