2015-12-27 11 views
6

Qual è il modo migliore per verificare su quale ramo sono attivo mercurial?Come verificare su quale ramo ci si trova con mercurial

hg log -l 5 

Questo sembra dimostrare sulle novità commit nel repository e non su stato di funzionamento come git sarebbe, quindi sto cercando qualcosa di simile git status suppongo, che mi avrebbe detto cosa ramo sono su. hg status non mi mostra nulla.

risposta

16

È possibile utilizzare il comando hg identify con l'-b per l'opzione ramo:

C:\Some\Repository> hg identify -b 
default 
13

hg branch. Suggerisco almeno di leggere hg help una volta: ^)

-1

Si potrebbe anche voler specificare esplicitamente la versione attualmente ritirata. Poi l'uscita di hg log tornerà quello che cercate:

hg log -r. 
0

Si potrebbe utilizzare hg sum

per esempio, supponiamo di avere due rami, A e B

[[email protected] ATS]# hg update A 
0 files updated, 0 files merged, 0 files removed, 0 files unresolved 
[[email protected] ATS]# hg sum 
parent: 1787:3f06e1a0260a 
made A 
branch: A 
commit: (clean) 
update: (current) 
[[email protected] ATS]# hg update B 
0 files updated, 0 files merged, 0 files removed, 0 files unresolved 
[[email protected] ATS]# hg sum 
parent: 1788:7ff3c507efd9 tip 
made B 
branch: B 
commit: (clean) 
update: (current) 
0
$ hg branch 

È puoi sempre usare il grep con una parola chiave per cercare. In questo caso,

$ hg help | grep branch` 

Ti dà:

branch  set or show the current branch name 
branches  list repository named branches 
graft   copy changes from other branches onto the current branch 
heads   show branch heads 
Problemi correlati