[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Aug 7 08:52:39 PDT 2017
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/e10d26040e07/
Changeset: e10d26040e07
User: ngoldbaum
Date: 2017-08-03 01:51:54+00:00
Summary: avoid error on gitpython 2.1.1
Affected #: 1 file
diff -r b8aedc8ed7a1da10290ac924dcf219eb854d0a52 -r e10d26040e07aa2b5208b06ec4473d57aa86ac09 yt/funcs.py
--- a/yt/funcs.py
+++ b/yt/funcs.py
@@ -506,47 +506,47 @@
print("Try: pip install gitpython")
return -1
with open(os.path.join(path, "yt_updater.log"), "a") as f:
- with git.Repo(path) as repo:
- if repo.is_dirty(untracked_files=True):
- print("Changes have been made to the yt source code so I won't ")
- print("update the code. You will have to do this yourself.")
- print("Here's a set of sample commands:")
- print("")
- print(" $ cd %s" % (path))
- print(" $ git stash")
- print(" $ git checkout master")
- print(" $ git pull")
- print(" $ git stash pop")
- print(" $ %s setup.py develop" % (sys.executable))
- print("")
- return 1
- if repo.active_branch.name != 'master':
- print("yt repository is not tracking the master branch so I won't ")
- print("update the code. You will have to do this yourself.")
- print("Here's a set of sample commands:")
- print("")
- print(" $ cd %s" % (path))
- print(" $ git checkout master")
- print(" $ git pull")
- print(" $ %s setup.py develop" % (sys.executable))
- print("")
- return 1
- print("Updating the repository")
- f.write("Updating the repository\n\n")
- old_version = repo.git.rev_parse('HEAD', short=12)
- try:
- remote = repo.remotes.yt_upstream
- except AttributeError:
- remote = repo.create_remote(
- 'yt_upstream', url='https://github.com/yt-project/yt')
- remote.fetch()
- master = repo.heads.master
- master.set_tracking_branch(remote.refs.master)
- master.checkout()
- remote.pull()
- new_version = repo.git.rev_parse('HEAD', short=12)
- f.write('Updated from %s to %s\n\n' % (old_version, new_version))
- rebuild_modules(path, f)
+ repo = git.Repo(path)
+ if repo.is_dirty(untracked_files=True):
+ print("Changes have been made to the yt source code so I won't ")
+ print("update the code. You will have to do this yourself.")
+ print("Here's a set of sample commands:")
+ print("")
+ print(" $ cd %s" % (path))
+ print(" $ git stash")
+ print(" $ git checkout master")
+ print(" $ git pull")
+ print(" $ git stash pop")
+ print(" $ %s setup.py develop" % (sys.executable))
+ print("")
+ return 1
+ if repo.active_branch.name != 'master':
+ print("yt repository is not tracking the master branch so I won't ")
+ print("update the code. You will have to do this yourself.")
+ print("Here's a set of sample commands:")
+ print("")
+ print(" $ cd %s" % (path))
+ print(" $ git checkout master")
+ print(" $ git pull")
+ print(" $ %s setup.py develop" % (sys.executable))
+ print("")
+ return 1
+ print("Updating the repository")
+ f.write("Updating the repository\n\n")
+ old_version = repo.git.rev_parse('HEAD', short=12)
+ try:
+ remote = repo.remotes.yt_upstream
+ except AttributeError:
+ remote = repo.create_remote(
+ 'yt_upstream', url='https://github.com/yt-project/yt')
+ remote.fetch()
+ master = repo.heads.master
+ master.set_tracking_branch(remote.refs.master)
+ master.checkout()
+ remote.pull()
+ new_version = repo.git.rev_parse('HEAD', short=12)
+ f.write('Updated from %s to %s\n\n' % (old_version, new_version))
+ rebuild_modules(path, f)
print('Updated successfully')
def update_hg(path):
@@ -612,8 +612,8 @@
print("Try: pip install gitpython")
return None
try:
- with git.Repo(path) as repo:
- return repo.git.rev_parse('HEAD', short=12)
+ repo = git.Repo(path)
+ return repo.git.rev_parse('HEAD', short=12)
except git.InvalidGitRepositoryError:
# path is not a git repository
return None
@@ -1148,4 +1148,4 @@
else:
# If something isn't iterable, we return 0
# to signify zero length (aka a scalar).
- return 0
\ No newline at end of file
+ return 0
https://bitbucket.org/yt_analysis/yt/commits/aba396f68b77/
Changeset: aba396f68b77
User: ngoldbaum
Date: 2017-08-07 15:52:27+00:00
Summary: Merge pull request #1523 from ngoldbaum/gitpython-old
avoid error on gitpython 2.1.1
Affected #: 1 file
diff -r 9a899ebd4ed06ce34bdf9caa98ae7e61e45b0259 -r aba396f68b779976b5a7acc76d0f868963d0e388 yt/funcs.py
--- a/yt/funcs.py
+++ b/yt/funcs.py
@@ -506,47 +506,47 @@
print("Try: pip install gitpython")
return -1
with open(os.path.join(path, "yt_updater.log"), "a") as f:
- with git.Repo(path) as repo:
- if repo.is_dirty(untracked_files=True):
- print("Changes have been made to the yt source code so I won't ")
- print("update the code. You will have to do this yourself.")
- print("Here's a set of sample commands:")
- print("")
- print(" $ cd %s" % (path))
- print(" $ git stash")
- print(" $ git checkout master")
- print(" $ git pull")
- print(" $ git stash pop")
- print(" $ %s setup.py develop" % (sys.executable))
- print("")
- return 1
- if repo.active_branch.name != 'master':
- print("yt repository is not tracking the master branch so I won't ")
- print("update the code. You will have to do this yourself.")
- print("Here's a set of sample commands:")
- print("")
- print(" $ cd %s" % (path))
- print(" $ git checkout master")
- print(" $ git pull")
- print(" $ %s setup.py develop" % (sys.executable))
- print("")
- return 1
- print("Updating the repository")
- f.write("Updating the repository\n\n")
- old_version = repo.git.rev_parse('HEAD', short=12)
- try:
- remote = repo.remotes.yt_upstream
- except AttributeError:
- remote = repo.create_remote(
- 'yt_upstream', url='https://github.com/yt-project/yt')
- remote.fetch()
- master = repo.heads.master
- master.set_tracking_branch(remote.refs.master)
- master.checkout()
- remote.pull()
- new_version = repo.git.rev_parse('HEAD', short=12)
- f.write('Updated from %s to %s\n\n' % (old_version, new_version))
- rebuild_modules(path, f)
+ repo = git.Repo(path)
+ if repo.is_dirty(untracked_files=True):
+ print("Changes have been made to the yt source code so I won't ")
+ print("update the code. You will have to do this yourself.")
+ print("Here's a set of sample commands:")
+ print("")
+ print(" $ cd %s" % (path))
+ print(" $ git stash")
+ print(" $ git checkout master")
+ print(" $ git pull")
+ print(" $ git stash pop")
+ print(" $ %s setup.py develop" % (sys.executable))
+ print("")
+ return 1
+ if repo.active_branch.name != 'master':
+ print("yt repository is not tracking the master branch so I won't ")
+ print("update the code. You will have to do this yourself.")
+ print("Here's a set of sample commands:")
+ print("")
+ print(" $ cd %s" % (path))
+ print(" $ git checkout master")
+ print(" $ git pull")
+ print(" $ %s setup.py develop" % (sys.executable))
+ print("")
+ return 1
+ print("Updating the repository")
+ f.write("Updating the repository\n\n")
+ old_version = repo.git.rev_parse('HEAD', short=12)
+ try:
+ remote = repo.remotes.yt_upstream
+ except AttributeError:
+ remote = repo.create_remote(
+ 'yt_upstream', url='https://github.com/yt-project/yt')
+ remote.fetch()
+ master = repo.heads.master
+ master.set_tracking_branch(remote.refs.master)
+ master.checkout()
+ remote.pull()
+ new_version = repo.git.rev_parse('HEAD', short=12)
+ f.write('Updated from %s to %s\n\n' % (old_version, new_version))
+ rebuild_modules(path, f)
print('Updated successfully')
def update_hg(path):
@@ -612,8 +612,8 @@
print("Try: pip install gitpython")
return None
try:
- with git.Repo(path) as repo:
- return repo.git.rev_parse('HEAD', short=12)
+ repo = git.Repo(path)
+ return repo.git.rev_parse('HEAD', short=12)
except git.InvalidGitRepositoryError:
# path is not a git repository
return None
@@ -1148,4 +1148,4 @@
else:
# If something isn't iterable, we return 0
# to signify zero length (aka a scalar).
- return 0
\ No newline at end of file
+ return 0
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list