##// END OF EJS Templates
shelve: add interactive mode...
Laurent Charignon -
r24478:95cbc77c default
parent child Browse files
Show More
@@ -228,8 +228,15 b' def createcmd(ui, repo, pats, opts):'
228 raise util.Abort(_("shelved change names may not start with '.'"))
228 raise util.Abort(_("shelved change names may not start with '.'"))
229 interactive = opts.get('interactive', False)
229 interactive = opts.get('interactive', False)
230
230
231 def interactivecommitfunc(ui, repo, *pats, **opts):
232 match = scmutil.match(repo['.'], pats, {})
233 message = opts['message']
234 return commitfunc(ui, repo, message, match, opts)
235 if not interactive:
231 node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
236 node = cmdutil.commit(ui, repo, commitfunc, pats, opts)
232
237 else:
238 node = cmdutil.dorecord(ui, repo, interactivecommitfunc, 'commit',
239 False, cmdutil.recordfilter, *pats, **opts)
233 if not node:
240 if not node:
234 stat = repo.status(match=scmutil.match(repo[None], pats, opts))
241 stat = repo.status(match=scmutil.match(repo[None], pats, opts))
235 if stat.deleted:
242 if stat.deleted:
@@ -791,4 +791,76 b' is a no-op), works (issue4398)'
791 abort: options '--delete' and '--name' may not be used together
791 abort: options '--delete' and '--name' may not be used together
792 [255]
792 [255]
793
793
794 Test interactive shelve
795 $ cat <<EOF >> $HGRCPATH
796 > [ui]
797 > interactive = true
798 > EOF
799 $ echo 'a' >> a/b
800 $ cat a/a >> a/b
801 $ echo 'x' >> a/b
802 $ mv a/b a/a
803 $ echo 'a' >> foo/foo
804 $ hg st
805 M a/a
806 ? a/a.orig
807 ? foo/foo
808 $ cat a/a
809 a
810 a
811 c
812 x
813 x
814 $ cat foo/foo
815 foo
816 a
817 $ hg shelve --interactive << EOF
818 > y
819 > y
820 > n
821 > EOF
822 diff --git a/a/a b/a/a
823 2 hunks, 2 lines changed
824 examine changes to 'a/a'? [Ynesfdaq?] y
825
826 @@ -1,3 +1,4 @@
827 +a
828 a
829 c
830 x
831 record change 1/2 to 'a/a'? [Ynesfdaq?] y
832
833 @@ -1,3 +2,4 @@
834 a
835 c
836 x
837 +x
838 record change 2/2 to 'a/a'? [Ynesfdaq?] n
839
840 shelved as test
841 merging a/a
842 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
843 $ cat a/a
844 a
845 c
846 x
847 x
848 $ cat foo/foo
849 foo
850 a
851 $ hg st
852 M a/a
853 ? foo/foo
854 $ hg unshelve
855 unshelving change 'test'
856 temporarily committing pending changes (restore with 'hg unshelve --abort')
857 rebasing shelved changes
858 rebasing 6:65b5d1c34c34 "changes to 'create conflict'" (tip)
859 merging a/a
860 $ cat a/a
861 a
862 a
863 c
864 x
865 x
794 $ cd ..
866 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now