Show More
@@ -558,7 +558,7 b' def unshelve(ui, repo, *shelved, **opts)' | |||||
558 | oldquiet = ui.quiet |
|
558 | oldquiet = ui.quiet | |
559 | try: |
|
559 | try: | |
560 | ui.quiet = True |
|
560 | ui.quiet = True | |
561 |
node = cmdutil.commit(ui, repo, commitfunc, |
|
561 | node = cmdutil.commit(ui, repo, commitfunc, [], tempopts) | |
562 | finally: |
|
562 | finally: | |
563 | ui.quiet = oldquiet |
|
563 | ui.quiet = oldquiet | |
564 | tmpwctx = repo[node] |
|
564 | tmpwctx = repo[node] |
@@ -837,10 +837,12 b' def bookmark(ui, repo, *names, **opts):' | |||||
837 | bookmarks.deletedivergent(repo, [target], mark) |
|
837 | bookmarks.deletedivergent(repo, [target], mark) | |
838 | return |
|
838 | return | |
839 |
|
839 | |||
|
840 | # consider successor changesets as well | |||
|
841 | foreground = obsolete.foreground(repo, [marks[mark]]) | |||
840 | deletefrom = [b for b in divs |
|
842 | deletefrom = [b for b in divs | |
841 | if repo[b].rev() in anc or b == target] |
|
843 | if repo[b].rev() in anc or b == target] | |
842 | bookmarks.deletedivergent(repo, deletefrom, mark) |
|
844 | bookmarks.deletedivergent(repo, deletefrom, mark) | |
843 | if bmctx.rev() in anc: |
|
845 | if bmctx.rev() in anc or target in foreground: | |
844 | ui.status(_("moving bookmark '%s' forward from %s\n") % |
|
846 | ui.status(_("moving bookmark '%s' forward from %s\n") % | |
845 | (mark, short(bmctx.node()))) |
|
847 | (mark, short(bmctx.node()))) | |
846 | return |
|
848 | return |
@@ -313,6 +313,18 b' def _abssource(repo, push=False, abort=T' | |||||
313 | if abort: |
|
313 | if abort: | |
314 | raise util.Abort(_("default path for subrepository not found")) |
|
314 | raise util.Abort(_("default path for subrepository not found")) | |
315 |
|
315 | |||
|
316 | def _sanitize(ui, path): | |||
|
317 | def v(arg, dirname, names): | |||
|
318 | if os.path.basename(dirname).lower() != '.hg': | |||
|
319 | return | |||
|
320 | for f in names: | |||
|
321 | if f.lower() == 'hgrc': | |||
|
322 | ui.warn( | |||
|
323 | _("warning: removing potentially hostile .hg/hgrc in '%s'" | |||
|
324 | % path)) | |||
|
325 | os.unlink(os.path.join(dirname, f)) | |||
|
326 | os.walk(path, v, None) | |||
|
327 | ||||
316 | def itersubrepos(ctx1, ctx2): |
|
328 | def itersubrepos(ctx1, ctx2): | |
317 | """find subrepos in ctx1 or ctx2""" |
|
329 | """find subrepos in ctx1 or ctx2""" | |
318 | # Create a (subpath, ctx) mapping where we prefer subpaths from |
|
330 | # Create a (subpath, ctx) mapping where we prefer subpaths from | |
@@ -989,6 +1001,7 b' class svnsubrepo(abstractsubrepo):' | |||||
989 | # update to a directory which has since been deleted and recreated. |
|
1001 | # update to a directory which has since been deleted and recreated. | |
990 | args.append('%s@%s' % (state[0], state[1])) |
|
1002 | args.append('%s@%s' % (state[0], state[1])) | |
991 | status, err = self._svncommand(args, failok=True) |
|
1003 | status, err = self._svncommand(args, failok=True) | |
|
1004 | _sanitize(self._ui, self._path) | |||
992 | if not re.search('Checked out revision [0-9]+.', status): |
|
1005 | if not re.search('Checked out revision [0-9]+.', status): | |
993 | if ('is already a working copy for a different URL' in err |
|
1006 | if ('is already a working copy for a different URL' in err | |
994 | and (self._wcchanged()[:2] == (False, False))): |
|
1007 | and (self._wcchanged()[:2] == (False, False))): | |
@@ -1249,6 +1262,7 b' class gitsubrepo(abstractsubrepo):' | |||||
1249 | self._gitcommand(['reset', 'HEAD']) |
|
1262 | self._gitcommand(['reset', 'HEAD']) | |
1250 | cmd.append('-f') |
|
1263 | cmd.append('-f') | |
1251 | self._gitcommand(cmd + args) |
|
1264 | self._gitcommand(cmd + args) | |
|
1265 | _sanitize(self._ui, self._path) | |||
1252 |
|
1266 | |||
1253 | def rawcheckout(): |
|
1267 | def rawcheckout(): | |
1254 | # no branch to checkout, check it out with no branch |
|
1268 | # no branch to checkout, check it out with no branch | |
@@ -1332,6 +1346,7 b' class gitsubrepo(abstractsubrepo):' | |||||
1332 | self.get(state) # fast forward merge |
|
1346 | self.get(state) # fast forward merge | |
1333 | elif base != self._state[1]: |
|
1347 | elif base != self._state[1]: | |
1334 | self._gitcommand(['merge', '--no-commit', revision]) |
|
1348 | self._gitcommand(['merge', '--no-commit', revision]) | |
|
1349 | _sanitize(self._ui, self._path) | |||
1335 |
|
1350 | |||
1336 | if self.dirty(): |
|
1351 | if self.dirty(): | |
1337 | if self._gitstate() != revision: |
|
1352 | if self._gitstate() != revision: |
@@ -1634,6 +1634,8 b' class url(object):' | |||||
1634 | <url path: '\\\\blah\\blah\\blah'> |
|
1634 | <url path: '\\\\blah\\blah\\blah'> | |
1635 | >>> url(r'\\blah\blah\blah#baz') |
|
1635 | >>> url(r'\\blah\blah\blah#baz') | |
1636 | <url path: '\\\\blah\\blah\\blah', fragment: 'baz'> |
|
1636 | <url path: '\\\\blah\\blah\\blah', fragment: 'baz'> | |
|
1637 | >>> url(r'file:///C:\users\me') | |||
|
1638 | <url scheme: 'file', path: 'C:\\users\\me'> | |||
1637 |
|
1639 | |||
1638 | Authentication credentials: |
|
1640 | Authentication credentials: | |
1639 |
|
1641 | |||
@@ -1651,7 +1653,7 b' class url(object):' | |||||
1651 | """ |
|
1653 | """ | |
1652 |
|
1654 | |||
1653 | _safechars = "!~*'()+" |
|
1655 | _safechars = "!~*'()+" | |
1654 | _safepchars = "/!~*'()+:" |
|
1656 | _safepchars = "/!~*'()+:\\" | |
1655 | _matchscheme = re.compile(r'^[a-zA-Z0-9+.\-]+:').match |
|
1657 | _matchscheme = re.compile(r'^[a-zA-Z0-9+.\-]+:').match | |
1656 |
|
1658 | |||
1657 | def __init__(self, path, parsequery=True, parsefragment=True): |
|
1659 | def __init__(self, path, parsequery=True, parsefragment=True): | |
@@ -1788,6 +1790,8 b' class url(object):' | |||||
1788 | 'file:///c:/tmp/foo/bar' |
|
1790 | 'file:///c:/tmp/foo/bar' | |
1789 | >>> print url(r'bundle:foo\bar') |
|
1791 | >>> print url(r'bundle:foo\bar') | |
1790 | bundle:foo\bar |
|
1792 | bundle:foo\bar | |
|
1793 | >>> print url(r'file:///D:\data\hg') | |||
|
1794 | file:///D:\data\hg | |||
1791 | """ |
|
1795 | """ | |
1792 | if self._localpath: |
|
1796 | if self._localpath: | |
1793 | s = self.path |
|
1797 | s = self.path |
@@ -71,7 +71,7 b' make $GITROOT pushable, by replacing it ' | |||||
71 | clone root |
|
71 | clone root | |
72 |
|
72 | |||
73 | $ cd t |
|
73 | $ cd t | |
74 | $ hg clone . ../tc |
|
74 | $ hg clone . ../tc 2> /dev/null | |
75 | updating to branch default |
|
75 | updating to branch default | |
76 | cloning subrepo s from $TESTTMP/gitroot |
|
76 | cloning subrepo s from $TESTTMP/gitroot | |
77 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
77 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
@@ -94,7 +94,7 b' update to previous substate' | |||||
94 | clone root, make local change |
|
94 | clone root, make local change | |
95 |
|
95 | |||
96 | $ cd ../t |
|
96 | $ cd ../t | |
97 | $ hg clone . ../ta |
|
97 | $ hg clone . ../ta 2> /dev/null | |
98 | updating to branch default |
|
98 | updating to branch default | |
99 | cloning subrepo s from $TESTTMP/gitroot |
|
99 | cloning subrepo s from $TESTTMP/gitroot | |
100 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
100 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
@@ -113,7 +113,7 b' clone root, make local change' | |||||
113 | clone root separately, make different local change |
|
113 | clone root separately, make different local change | |
114 |
|
114 | |||
115 | $ cd ../t |
|
115 | $ cd ../t | |
116 | $ hg clone . ../tb |
|
116 | $ hg clone . ../tb 2> /dev/null | |
117 | updating to branch default |
|
117 | updating to branch default | |
118 | cloning subrepo s from $TESTTMP/gitroot |
|
118 | cloning subrepo s from $TESTTMP/gitroot | |
119 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
119 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
@@ -199,7 +199,7 b' make upstream git changes' | |||||
199 | make and push changes to hg without updating the subrepo |
|
199 | make and push changes to hg without updating the subrepo | |
200 |
|
200 | |||
201 | $ cd ../t |
|
201 | $ cd ../t | |
202 | $ hg clone . ../td |
|
202 | $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.' | |
203 | updating to branch default |
|
203 | updating to branch default | |
204 | cloning subrepo s from $TESTTMP/gitroot |
|
204 | cloning subrepo s from $TESTTMP/gitroot | |
205 | checking out detached HEAD in subrepo s |
|
205 | checking out detached HEAD in subrepo s | |
@@ -317,7 +317,7 b' create nested repo' | |||||
317 | $ hg add b |
|
317 | $ hg add b | |
318 | $ hg commit -m b |
|
318 | $ hg commit -m b | |
319 |
|
319 | |||
320 | $ hg clone ../t inner |
|
320 | $ hg clone ../t inner 2> /dev/null | |
321 | updating to branch default |
|
321 | updating to branch default | |
322 | cloning subrepo s from $TESTTMP/gitroot |
|
322 | cloning subrepo s from $TESTTMP/gitroot | |
323 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
323 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
@@ -345,7 +345,7 b' relative source expansion' | |||||
345 |
|
345 | |||
346 | $ cd .. |
|
346 | $ cd .. | |
347 | $ mkdir d |
|
347 | $ mkdir d | |
348 | $ hg clone t d/t |
|
348 | $ hg clone t d/t 2> /dev/null | |
349 | updating to branch default |
|
349 | updating to branch default | |
350 | cloning subrepo s from $TESTTMP/gitroot |
|
350 | cloning subrepo s from $TESTTMP/gitroot | |
351 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
351 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
@@ -364,7 +364,7 b" Don't crash if the subrepo is missing" | |||||
364 | $ hg commit --subrepos -qm missing |
|
364 | $ hg commit --subrepos -qm missing | |
365 | abort: subrepo s is missing (in subrepo s) |
|
365 | abort: subrepo s is missing (in subrepo s) | |
366 | [255] |
|
366 | [255] | |
367 | $ hg update -C |
|
367 | $ hg update -C 2> /dev/null | |
368 | cloning subrepo s from $TESTTMP/gitroot |
|
368 | cloning subrepo s from $TESTTMP/gitroot | |
369 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
369 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
370 | $ hg sum | grep commit |
|
370 | $ hg sum | grep commit |
@@ -206,6 +206,7 b' Test no-argument update to a successor o' | |||||
206 | |/ |
|
206 | |/ | |
207 | o 0:60829823a42a 0 |
|
207 | o 0:60829823a42a 0 | |
208 |
|
208 | |||
|
209 | $ hg book bm -r 3 | |||
209 | $ hg status |
|
210 | $ hg status | |
210 | M foo |
|
211 | M foo | |
211 |
|
212 | |||
@@ -218,10 +219,16 b' We add simple obsolescence marker betwee' | |||||
218 | $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
|
219 | $ hg debugobsolete 6efa171f091b00a3c35edc15d48c52a498929953 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
219 | $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206 |
|
220 | $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa d047485b3896813b2a624e86201983520f003206 | |
220 |
|
221 | |||
221 | Test that 5 is detected as a valid destination from 3 |
|
222 | Test that 5 is detected as a valid destination from 3 and also accepts moving | |
|
223 | the bookmark (issue4015) | |||
|
224 | ||||
222 | $ hg up --quiet --hidden 3 |
|
225 | $ hg up --quiet --hidden 3 | |
223 | $ hg up 5 |
|
226 | $ hg up 5 | |
224 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
227 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
228 | $ hg book bm | |||
|
229 | moving bookmark 'bm' forward from 6efa171f091b | |||
|
230 | $ hg bookmarks | |||
|
231 | * bm 5:ff252e8273df | |||
225 |
|
232 | |||
226 | Test that 5 is detected as a valid destination from 1 |
|
233 | Test that 5 is detected as a valid destination from 1 | |
227 | $ hg up --quiet 0 # we should be able to update to 3 directly |
|
234 | $ hg up --quiet 0 # we should be able to update to 3 directly |
General Comments 0
You need to be logged in to leave comments.
Login now