2017-05-22 23:38:37 +03:00
|
|
|
from mercurial import registrar
|
2017-02-17 19:01:02 +03:00
|
|
|
from mercurial.node import hex, nullid
|
|
|
|
|
|
|
|
cmdtable = {}
|
2017-05-22 23:38:37 +03:00
|
|
|
command = registrar.command(cmdtable)
|
2017-02-17 19:01:02 +03:00
|
|
|
testedwith = 'ships-with-fb-hgext'
|
|
|
|
|
|
|
|
@command('whereami')
|
|
|
|
def whereami(ui, repo, *args, **opts):
|
|
|
|
"""output the current working directory parents
|
|
|
|
|
|
|
|
Outputs the hashes of current working directory parents separated
|
|
|
|
by newline.
|
|
|
|
"""
|
|
|
|
parents = repo.dirstate.parents()
|
|
|
|
ui.status('%s\n' % hex(parents[0]))
|
|
|
|
if parents[1] != nullid:
|
|
|
|
ui.status('%s\n' % hex(parents[1]))
|