comparison mercurial/commands.py @ 1439:65cbe22b03fa

allow 'hg out' / 'hg in' to show newest commit first
author Michal Kvasnica <kvasnica@gmail.com>
date Mon, 24 Oct 2005 16:59:31 -0700
parents ea51d296085f
children bf109779f48b
comparison
equal deleted inserted replaced
1438:c22da894e4cc 1439:65cbe22b03fa
1386 raise util.Abort(_("incoming doesn't work for remote repositories yet")) 1386 raise util.Abort(_("incoming doesn't work for remote repositories yet"))
1387 o = repo.findincoming(other) 1387 o = repo.findincoming(other)
1388 if not o: 1388 if not o:
1389 return 1389 return
1390 o = other.newer(o) 1390 o = other.newer(o)
1391 if opts['newest_first']:
1392 o.reverse()
1391 for n in o: 1393 for n in o:
1392 parents = [p for p in other.changelog.parents(n) if p != nullid] 1394 parents = [p for p in other.changelog.parents(n) if p != nullid]
1393 if opts['no_merges'] and len(parents) == 2: 1395 if opts['no_merges'] and len(parents) == 2:
1394 continue 1396 continue
1395 show_changeset(ui, other, changenode=n) 1397 show_changeset(ui, other, changenode=n)
1549 """ 1551 """
1550 dest = ui.expandpath(dest) 1552 dest = ui.expandpath(dest)
1551 other = hg.repository(ui, dest) 1553 other = hg.repository(ui, dest)
1552 o = repo.findoutgoing(other) 1554 o = repo.findoutgoing(other)
1553 o = repo.newer(o) 1555 o = repo.newer(o)
1556 if opts['newest_first']:
1557 o.reverse()
1554 for n in o: 1558 for n in o:
1555 parents = [p for p in repo.changelog.parents(n) if p != nullid] 1559 parents = [p for p in repo.changelog.parents(n) if p != nullid]
1556 if opts['no_merges'] and len(parents) == 2: 1560 if opts['no_merges'] and len(parents) == 2:
1557 continue 1561 continue
1558 show_changeset(ui, repo, changenode=n) 1562 show_changeset(ui, repo, changenode=n)
2252 ('f', 'force', None, _('skip check for outstanding uncommitted changes')), 2256 ('f', 'force', None, _('skip check for outstanding uncommitted changes')),
2253 ('b', 'base', "", _('base path'))], 2257 ('b', 'base', "", _('base path'))],
2254 "hg import [-f] [-p NUM] [-b BASE] PATCH..."), 2258 "hg import [-f] [-p NUM] [-b BASE] PATCH..."),
2255 "incoming|in": (incoming, 2259 "incoming|in": (incoming,
2256 [('M', 'no-merges', None, _("do not show merges")), 2260 [('M', 'no-merges', None, _("do not show merges")),
2257 ('p', 'patch', None, _('show patch'))], 2261 ('p', 'patch', None, _('show patch')),
2258 _('hg incoming [-p] [SOURCE]')), 2262 ('n', 'newest-first', None, _('show newest record first'))],
2263 _('hg incoming [-p] [-n] [-M] [SOURCE]')),
2259 "^init": (init, [], _('hg init [DEST]')), 2264 "^init": (init, [], _('hg init [DEST]')),
2260 "locate": 2265 "locate":
2261 (locate, 2266 (locate,
2262 [('r', 'rev', '', _('search the repository as it stood at rev')), 2267 [('r', 'rev', '', _('search the repository as it stood at rev')),
2263 ('0', 'print0', None, _('end filenames with NUL, for use with xargs')), 2268 ('0', 'print0', None, _('end filenames with NUL, for use with xargs')),
2277 ('p', 'patch', None, _('show patch'))], 2282 ('p', 'patch', None, _('show patch'))],
2278 _('hg log [-I] [-X] [-r REV]... [-p] [FILE]')), 2283 _('hg log [-I] [-X] [-r REV]... [-p] [FILE]')),
2279 "manifest": (manifest, [], _('hg manifest [REV]')), 2284 "manifest": (manifest, [], _('hg manifest [REV]')),
2280 "outgoing|out": (outgoing, 2285 "outgoing|out": (outgoing,
2281 [('M', 'no-merges', None, _("do not show merges")), 2286 [('M', 'no-merges', None, _("do not show merges")),
2282 ('p', 'patch', None, _('show patch'))], 2287 ('p', 'patch', None, _('show patch')),
2283 _('hg outgoing [-p] [DEST]')), 2288 ('n', 'newest-first', None, _('show newest record first'))],
2289 _('hg outgoing [-p] [-n] [-M] [DEST]')),
2284 "parents": (parents, [], _('hg parents [REV]')), 2290 "parents": (parents, [], _('hg parents [REV]')),
2285 "paths": (paths, [], _('hg paths [NAME]')), 2291 "paths": (paths, [], _('hg paths [NAME]')),
2286 "^pull": 2292 "^pull":
2287 (pull, 2293 (pull,
2288 [('u', 'update', None, _('update the working directory to tip after pull')), 2294 [('u', 'update', None, _('update the working directory to tip after pull')),