batchfetch 1.0.9__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {batchfetch-1.0.9/batchfetch.egg-info → batchfetch-1.1.0}/PKG-INFO +1 -1
- {batchfetch-1.0.9 → batchfetch-1.1.0}/batchfetch/batchfetch_git.py +40 -32
- {batchfetch-1.0.9 → batchfetch-1.1.0/batchfetch.egg-info}/PKG-INFO +1 -1
- {batchfetch-1.0.9 → batchfetch-1.1.0}/setup.py +1 -1
- {batchfetch-1.0.9 → batchfetch-1.1.0}/.gitignore +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/LICENSE +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/README.md +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/batchfetch/__init__.py +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/batchfetch/batchfetch_base.py +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/batchfetch/batchfetch_cli.py +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/batchfetch/helpers.py +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/batchfetch.egg-info/SOURCES.txt +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/batchfetch.egg-info/dependency_links.txt +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/batchfetch.egg-info/entry_points.txt +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/batchfetch.egg-info/requires.txt +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/batchfetch.egg-info/top_level.txt +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/run_tests.sh +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/setup.cfg +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/tests/data/test-md5sum.txt +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/tests/data/test-run_simple.sh +0 -0
- {batchfetch-1.0.9 → batchfetch-1.1.0}/tests/test_helpers.py +0 -0
|
@@ -209,57 +209,65 @@ class BatchFetchGit(BatchFetchBase):
|
|
|
209
209
|
|
|
210
210
|
# Merge
|
|
211
211
|
do_git_pull = self["git_pull"]
|
|
212
|
-
disable_merge = False
|
|
213
212
|
if self["reference"]:
|
|
213
|
+
do_git_pull = False
|
|
214
214
|
commit_ref = None
|
|
215
|
+
|
|
215
216
|
try:
|
|
216
217
|
# Returns the commit ref of the branch or commit
|
|
217
|
-
|
|
218
|
+
#
|
|
219
|
+
# If the tag is annotated, it points to a tag object, not
|
|
220
|
+
# directly to a commit. You need to resolve it to the commit it
|
|
221
|
+
# points to. Using `git rev-parse <tagname>^{commit}` allows
|
|
222
|
+
# getting the right reference.
|
|
223
|
+
commit_ref = self._git_tags(self["reference"] + "^{commit}")[0]
|
|
218
224
|
except GitReferenceDoesNotExist:
|
|
219
|
-
# The reference does not exist. We should git pull
|
|
220
|
-
#
|
|
225
|
+
# The wanted reference does not exist. We should git pull in
|
|
226
|
+
# case we can get the reference
|
|
221
227
|
do_git_pull = True
|
|
222
228
|
else: # The reference exists
|
|
223
|
-
if not self._git_is_local_branch(self["reference"]):
|
|
224
|
-
# This is not a real branch where we can merge
|
|
225
|
-
disable_merge = True
|
|
226
|
-
|
|
227
229
|
try:
|
|
228
|
-
#
|
|
229
|
-
|
|
230
|
+
# If the tag is annotated, it points to a tag object, not
|
|
231
|
+
# directly to a commit. You need to resolve it to the
|
|
232
|
+
# commit it points to. Using `git rev-parse
|
|
233
|
+
# <tagname>^{commit}` allows getting the right reference.
|
|
234
|
+
commit_ref_head = self._git_tags("HEAD^{commit}")[0]
|
|
230
235
|
except GitReferenceDoesNotExist:
|
|
231
236
|
# HEAD is detached
|
|
232
237
|
commit_ref_head = None
|
|
233
238
|
|
|
234
239
|
# The wanted commit reference does not exist
|
|
235
240
|
# Or the commit ref of HEAD hasn't changed
|
|
236
|
-
if
|
|
237
|
-
do_git_pull = True
|
|
238
|
-
else:
|
|
241
|
+
if commit_ref and commit_ref_head == commit_ref:
|
|
239
242
|
do_git_pull = False
|
|
243
|
+
else:
|
|
244
|
+
do_git_pull = True
|
|
240
245
|
|
|
241
246
|
if not do_git_pull:
|
|
242
|
-
self.add_output(self.indent_spaces +
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
+
self.add_output(self.indent_spaces + "[INFO] git pull ignored\n")
|
|
248
|
+
return git_merge
|
|
249
|
+
|
|
250
|
+
# Fetch
|
|
251
|
+
cmd = ["git", "fetch", "origin"]
|
|
252
|
+
self._run(cmd, cwd=str(self.git_local_dir), env=self.env)
|
|
247
253
|
|
|
248
|
-
|
|
254
|
+
# Merge
|
|
255
|
+
real_branch = self._git_is_local_branch("HEAD")
|
|
256
|
+
if real_branch:
|
|
257
|
+
# TODO: only merge when difference from upstream
|
|
249
258
|
commit_ref_head = self._git_ref(cwd=self.git_local_dir)
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
env=self.env)
|
|
259
|
+
self._run(["git", "merge", "--ff-only"],
|
|
260
|
+
cwd=str(self.git_local_dir), env=self.env)
|
|
261
|
+
git_ref_after_merge = self._git_ref(cwd=self.git_local_dir)
|
|
262
|
+
if commit_ref_head != git_ref_after_merge:
|
|
263
|
+
git_merge = True
|
|
264
|
+
self.set_changed(True)
|
|
265
|
+
self._run(["git", "log",
|
|
266
|
+
'--pretty=format:"%h %ad %s [%cn]"',
|
|
267
|
+
"--decorate", "--date=short",
|
|
268
|
+
f"{commit_ref_head}..{git_ref_after_merge}"],
|
|
269
|
+
cwd=str(self.git_local_dir),
|
|
270
|
+
env=self.env)
|
|
263
271
|
|
|
264
272
|
return git_merge
|
|
265
273
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|