Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
-import sys, os, glob, popen2
+import sys, os, popen2
from stgit.utils import *
def switch_branch(name):
"""Switch to a git branch
"""
+ global __head
+
new_head = os.path.join('refs', 'heads', name)
if not branch_exists(new_head):
raise GitException, 'Branch "%s" does not exist' % name
def rm(files, force = False):
"""Remove a file from the repository
"""
- if force:
- git_opt = '--force-remove'
- else:
- git_opt = '--remove'
-
if not force:
for f in files:
if os.path.exists(f):
# this can fail if there are conflicts
if os.system('git-merge-index -o -q gitmergeonefile.py -a') != 0:
- raise GitException, 'git-merge-cache failed (possible conflicts)'
+ raise GitException, 'git-merge-index failed (possible conflicts)'
def status(files = [], modified = False, new = False, deleted = False,
conflict = False, unknown = False, noexclude = False):