googlearchive/git-rv

sync --continue does not set the last synced hash value

Closed this issue · 2 comments

git rv sync --continue does not set the last synced hash value in the check_continue method. While we're at it, non-existent globals FINISHED and EXPORT are reference which should instead refer to the class "constants" self.FINISHED and self.EXPORT.

The seeds of a fix:

diff --git a/sync.py b/sync.py
index 819db1f..09ee048 100644
--- a/sync.py
+++ b/sync.py
@@ -139,9 +139,13 @@ class SyncAction(object):
             commits = utils.get_commits(self.__last_commit, 'HEAD')
             if len(commits) == 0:
                 print 'Please make a commit after resolving the merge conflict.'
-                self.state = FINISHED
+                self.state = self.FINISHED
             elif len(commits) == 1:
-                self.state = EXPORT
+                remote = self.__rietveld_info.remote_info.remote
+                remote_branch = self.__rietveld_info.remote_info.branch
+                remote_branch_ref = '%s/%s' % (remote, remote_branch)
+                self.__last_synced = utils.get_head_commit(remote_branch_ref)
+                self.state = self.EXPORT
             else:
                 template_args = {'commit': commits[-1]}
                 print TOO_MANY_COMMITS_AFTER_CONTINUE % template_args

/cc @tmatsuo

Thanks to @tmatsuo for the review-o.