def test_commit(self): # modify one file self.site.save_file('content/index.txt', 'different stuff') vc_add_tracked() vc_commit('hello') changed = vc_status() expected = ChangedFiles() self.assertEquals(expected, changed)
def test_add_tracked(self): # modify one file self.site.save_file('content/index.txt', 'different stuff') # add another new file self.site.save_file('content/newfile.txt', 'blah') vc_add_tracked() changed = vc_status() expected = ChangedFiles(modified=['content/index.txt']) self.assertEquals(expected, changed)
def _sync(strict, addnew, push, message): if not strict: # if addnew is True, this means we need to add all untracked files # to the index. The -A will do that. Otheriwse we just do a -u, # which will only update the tracked files. if addnew: vc_add_tracked_and_new() else: vc_add_tracked() # at this point we should have an almost snapshot of what we want # to commit in the index. It's "almost" because we now may want # to fix up or add the timestamps. call_plugins('on_pre_sync', vc_status()) # readjust the index with whatever changes were made by # the pre_sync plugins vc_add_tracked() vc_commit(message) if push: vc_push()