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