Show More
@@ -1526,18 +1526,26 b' def import_(ui, repo, patch1, *patches, ' | |||||
1526 | message = None |
|
1526 | message = None | |
1527 | ui.debug(_('message:\n%s\n') % message) |
|
1527 | ui.debug(_('message:\n%s\n') % message) | |
1528 |
|
1528 | |||
1529 | files = {} |
|
1529 | wp = repo.workingctx().parents() | |
1530 | if opts.get('exact'): |
|
1530 | if opts.get('exact'): | |
1531 | if not nodeid or not p1: |
|
1531 | if not nodeid or not p1: | |
1532 | raise util.Abort(_('not a mercurial patch')) |
|
1532 | raise util.Abort(_('not a mercurial patch')) | |
1533 | p1 = repo.lookup(p1) |
|
1533 | p1 = repo.lookup(p1) | |
1534 | p2 = repo.lookup(p2 or hex(nullid)) |
|
1534 | p2 = repo.lookup(p2 or hex(nullid)) | |
1535 |
|
1535 | |||
1536 | wctx = repo.workingctx() |
|
|||
1537 | wp = repo.workingctx().parents() |
|
|||
1538 | if p1 != wp[0].node(): |
|
1536 | if p1 != wp[0].node(): | |
1539 | hg.clean(repo, p1, wlock=wlock) |
|
1537 | hg.clean(repo, p1, wlock=wlock) | |
1540 | repo.dirstate.setparents(p1, p2) |
|
1538 | repo.dirstate.setparents(p1, p2) | |
|
1539 | elif p2: | |||
|
1540 | try: | |||
|
1541 | p1 = repo.lookup(p1) | |||
|
1542 | p2 = repo.lookup(p2) | |||
|
1543 | if p1 == wp[0].node(): | |||
|
1544 | repo.dirstate.setparents(p1, p2) | |||
|
1545 | except RepoError: | |||
|
1546 | pass | |||
|
1547 | ||||
|
1548 | files = {} | |||
1541 | try: |
|
1549 | try: | |
1542 | fuzz = patch.patch(tmpname, ui, strip=strip, cwd=repo.root, |
|
1550 | fuzz = patch.patch(tmpname, ui, strip=strip, cwd=repo.root, | |
1543 | files=files) |
|
1551 | files=files) |
General Comments 0
You need to be logged in to leave comments.
Login now