< prev index next >

vcs/src/main/resources/ext.py

Print this page
*** 21,10 ***
--- 21,12 ---
  
  import mercurial
  import mercurial.patch
  import mercurial.mdiff
  import mercurial.util
+ import mercurial.hg
+ import mercurial.node
  import difflib
  import sys
  
  # space separated version list
  testedwith = '4.9.2 5.0.2'

*** 286,5 ***
--- 288,14 ---
          else:
              write('100644 blob ')
          write(nullHash)
          write('\t')
          writeln(filename)
+ 
+ @command('ls-remote', [],  'hg ls-remote PATH')
+ def ls_remote(ui, repo, path, **opts):
+     peer = mercurial.hg.peer(ui or repo, opts, ui.expandpath(path))
+     for branch, heads in peer.branchmap().iteritems():
+         for head in heads:
+             write(mercurial.node.hex(head))
+             write("\t")
+             writeln(branch)
< prev index next >