Show More
@@ -2013,13 +2013,11 b' def paths(ui, repo, search=None):' | |||||
2013 | for name, path in ui.configitems("paths"): |
|
2013 | for name, path in ui.configitems("paths"): | |
2014 | ui.write("%s = %s\n" % (name, path)) |
|
2014 | ui.write("%s = %s\n" % (name, path)) | |
2015 |
|
2015 | |||
2016 |
def postincoming(ui, repo, modheads, optupdate |
|
2016 | def postincoming(ui, repo, modheads, optupdate): | |
2017 | if modheads == 0: |
|
2017 | if modheads == 0: | |
2018 | return |
|
2018 | return | |
2019 | if optupdate: |
|
2019 | if optupdate: | |
2020 |
if |
|
2020 | if modheads == 1: | |
2021 | return hg.update(repo, repo.lookup('default')) |
|
|||
2022 | elif modheads == 1: |
|
|||
2023 | return hg.update(repo, repo.changelog.tip()) # update |
|
2021 | return hg.update(repo, repo.changelog.tip()) # update | |
2024 | else: |
|
2022 | else: | |
2025 | ui.status(_("not updating, since new heads added\n")) |
|
2023 | ui.status(_("not updating, since new heads added\n")) | |
@@ -2081,9 +2079,8 b' def pull(ui, repo, source="default", **o' | |||||
2081 | error = _("Other repository doesn't support revision lookup, so a rev cannot be specified.") |
|
2079 | error = _("Other repository doesn't support revision lookup, so a rev cannot be specified.") | |
2082 | raise util.Abort(error) |
|
2080 | raise util.Abort(error) | |
2083 |
|
2081 | |||
2084 | wasempty = repo.changelog.count() == 0 |
|
|||
2085 | modheads = repo.pull(other, heads=revs, force=opts['force']) |
|
2082 | modheads = repo.pull(other, heads=revs, force=opts['force']) | |
2086 |
return postincoming(ui, repo, modheads, opts['update'] |
|
2083 | return postincoming(ui, repo, modheads, opts['update']) | |
2087 |
|
2084 | |||
2088 | def push(ui, repo, dest=None, **opts): |
|
2085 | def push(ui, repo, dest=None, **opts): | |
2089 | """push changes to the specified destination |
|
2086 | """push changes to the specified destination | |
@@ -2647,7 +2644,6 b' def unbundle(ui, repo, fname1, *fnames, ' | |||||
2647 | """ |
|
2644 | """ | |
2648 | fnames = (fname1,) + fnames |
|
2645 | fnames = (fname1,) + fnames | |
2649 | result = None |
|
2646 | result = None | |
2650 | wasempty = repo.changelog.count() == 0 |
|
|||
2651 | for fname in fnames: |
|
2647 | for fname in fnames: | |
2652 | if os.path.exists(fname): |
|
2648 | if os.path.exists(fname): | |
2653 | f = open(fname, "rb") |
|
2649 | f = open(fname, "rb") | |
@@ -2656,7 +2652,7 b' def unbundle(ui, repo, fname1, *fnames, ' | |||||
2656 | gen = changegroup.readbundle(f, fname) |
|
2652 | gen = changegroup.readbundle(f, fname) | |
2657 | modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) |
|
2653 | modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) | |
2658 |
|
2654 | |||
2659 |
return postincoming(ui, repo, modheads, opts['update'] |
|
2655 | return postincoming(ui, repo, modheads, opts['update']) | |
2660 |
|
2656 | |||
2661 | def update(ui, repo, node=None, rev=None, clean=False, date=None): |
|
2657 | def update(ui, repo, node=None, rev=None, clean=False, date=None): | |
2662 | """update working directory |
|
2658 | """update working directory |
General Comments 0
You need to be logged in to leave comments.
Login now