We study the tight-binding model for a graphene tube with perimeter N
threaded by a magnetic field. We show exactly that this model has different
nontrivial topological phases as the flux changes. The winding number, as an
indicator of topological quantum phase transition (QPT) fixes at N/3 if N/3
equals to its integer part [N/3], otherwise it jumps between [N/3] and [N/3]+1
periodically as the flux varies a flux quantum. For an open tube with zigzag
boundary condition, exact edge states are obtained. There exist two perfect
midgap edge states, in which the particle is completely located at the
boundary, even for a tube with finite length. The threading flux can be
employed to control the quantum states: transferring the perfect edge state
from one end to the other, or generating maximal entanglement between them