# HG changeset patch # User Bryan O'Sullivan # Date 1184792168 25200 # Node ID bcba70b8006d9a8a93385bc33647aef6a0360440 # Parent 7d745e9d2cf03853801a32f4edafcab5e8fe2a4d Better fix for issue 622 than we had in c4dd58af0fc8. diff -r 7d745e9d2cf0 -r bcba70b8006d mercurial/commands.py --- a/mercurial/commands.py Wed Jul 18 16:46:20 2007 +0200 +++ b/mercurial/commands.py Wed Jul 18 13:56:08 2007 -0700 @@ -2028,13 +2028,11 @@ for name, path in ui.configitems("paths"): ui.write("%s = %s\n" % (name, path)) -def postincoming(ui, repo, modheads, optupdate, wasempty): +def postincoming(ui, repo, modheads, optupdate): if modheads == 0: return if optupdate: - if wasempty: - return hg.update(repo, repo.lookup('default')) - elif modheads == 1: + if modheads == 1: return hg.update(repo, repo.changelog.tip()) # update else: ui.status(_("not updating, since new heads added\n")) @@ -2096,9 +2094,8 @@ error = _("Other repository doesn't support revision lookup, so a rev cannot be specified.") raise util.Abort(error) - wasempty = repo.changelog.count() == 0 modheads = repo.pull(other, heads=revs, force=opts['force']) - return postincoming(ui, repo, modheads, opts['update'], wasempty) + return postincoming(ui, repo, modheads, opts['update']) def push(ui, repo, dest=None, **opts): """push changes to the specified destination @@ -2662,7 +2659,6 @@ """ fnames = (fname1,) + fnames result = None - wasempty = repo.changelog.count() == 0 for fname in fnames: if os.path.exists(fname): f = open(fname, "rb") @@ -2671,7 +2667,7 @@ gen = changegroup.readbundle(f, fname) modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) - return postincoming(ui, repo, modheads, opts['update'], wasempty) + return postincoming(ui, repo, modheads, opts['update']) def update(ui, repo, node=None, rev=None, clean=False, date=None): """update working directory