Permalink
Browse files

force-update default bookmark on pull

  • Loading branch information...
1 parent b1cc349 commit 1b6d1a359a36cf11d37efb846470e65fa479100c @rfk committed Oct 4, 2011
Showing with 9 additions and 5 deletions.
  1. +9 −5 git_remote_hg/__init__.py
View
@@ -170,17 +170,21 @@ def _do(self, *cmd, **kwds):
def pull(self):
"""Grab any changes from the remote repository."""
- self._do("hg", "pull", cwd=self.hg_repo_dir)
- self._do("hg", "gexport", cwd=self.hg_repo_dir)
+ hg_repo_dir = self.hg_repo_dir
+ self._do("hg", "pull", cwd=hg_repo_dir)
+ self._do("hg", "bookmark", "-fr", "default", "master", cwd=hg_repo_dir)
+ self._do("hg", "gexport", cwd=hg_repo_dir)
def push(self):
"""Push any changes into the remote repository."""
- self._do("hg", "gimport", cwd=self.hg_repo_dir)
- self._do("hg", "push", cwd=self.hg_repo_dir)
+ hg_repo_dir = self.hg_repo_dir
+ self._do("hg", "gimport", cwd=hg_repo_dir)
+ self._do("hg", "push", cwd=hg_repo_dir)
def initialize_hg_repo(self):
hg_repo_dir = self.hg_repo_dir
- os.makedirs(os.path.dirname(hg_repo_dir))
+ if not os.path.isdir(os.path.dirname(hg_repo_dir)):
+ os.makedirs(os.path.dirname(hg_repo_dir))
self._do("hg", "clone", self.hg_url, hg_repo_dir)
self._do("hg", "update", "null", cwd=hg_repo_dir)
with open(os.path.join(hg_repo_dir, "README.txt"), "wt") as f:

0 comments on commit 1b6d1a3

Please sign in to comment.