##// END OF EJS Templates
shelve: do not update when keeping changes, just move the dirstate...
Jordi Gutiérrez Hermoso -
r42180:50d5e64e default
parent child Browse files
Show More
@@ -499,14 +499,19 b' def _docreatecmd(ui, repo, pats, opts):'
499 return 1
499 return 1
500
500
501 # Create a matcher so that prefetch doesn't attempt to fetch
501 # Create a matcher so that prefetch doesn't attempt to fetch
502 # the entire repository pointlessly
502 # the entire repository pointlessly, and as an optimisation
503 # for movedirstate, if needed.
503 match = scmutil.matchfiles(repo, repo[node].files())
504 match = scmutil.matchfiles(repo, repo[node].files())
504 _shelvecreatedcommit(repo, node, name, match)
505 _shelvecreatedcommit(repo, node, name, match)
505
506
506 if ui.formatted():
507 if ui.formatted():
507 desc = stringutil.ellipsis(desc, ui.termwidth())
508 desc = stringutil.ellipsis(desc, ui.termwidth())
508 ui.status(_('shelved as %s\n') % name)
509 ui.status(_('shelved as %s\n') % name)
509 hg.update(repo, parent.node())
510 if opts['keep']:
511 with repo.dirstate.parentchange():
512 scmutil.movedirstate(repo, parent, match)
513 else:
514 hg.update(repo, parent.node())
510 if origbranch != repo['.'].branch() and not _isbareshelve(pats, opts):
515 if origbranch != repo['.'].branch() and not _isbareshelve(pats, opts):
511 repo.dirstate.setbranch(origbranch)
516 repo.dirstate.setbranch(origbranch)
512
517
@@ -928,6 +928,20 b' with general delta'
928 Stream params: {Compression: BZ}
928 Stream params: {Compression: BZ}
929 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
929 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
930 330882a04d2ce8487636b1fb292e5beea77fa1e3
930 330882a04d2ce8487636b1fb292e5beea77fa1e3
931
932 Test shelve --keep
933
934 $ hg unshelve
935 unshelving change 'default'
936 $ hg shelve --keep
937 shelved as default
938 $ hg diff
939 diff --git a/jungle b/jungle
940 new file mode 100644
941 --- /dev/null
942 +++ b/jungle
943 @@ -0,0 +1,1 @@
944 +babar
931 $ cd ..
945 $ cd ..
932
946
933 Test visibility of in-memory changes inside transaction to external hook
947 Test visibility of in-memory changes inside transaction to external hook
General Comments 0
You need to be logged in to leave comments. Login now