Permalink
Browse files

Merge branch 'release-0.7.x'

  • Loading branch information...
2 parents 12488a0 + 416b6a2 commit ff0a04e281fa28593e4901223e976f549352b6f0 @chipx86 chipx86 committed Jan 19, 2018
@@ -82,7 +82,7 @@ set _PYTHON_INSTALLER=%TEMP%\python-%PYTHON_VERSION%.msi
if not exist "%PYTHON_DEP%" (
if not exist "%_PYTHON_INSTALLER%" (
- echo Downloading Python v%PYTHON_VERSION%...
+ echo Preparing to download Python v%PYTHON_VERSION%...
call :DownloadAndVerify %PYTHON_URL% ^
"%_PYTHON_INSTALLER%" ^
%PYTHON_MD5% || exit /B 1
@@ -92,8 +92,6 @@ if not exist "%PYTHON_DEP%" (
echo Running the installer...
msiexec /quiet /a "%_PYTHON_INSTALLER%" TARGETDIR="%PYTHON_DEP%"
-
- del /F /Q "%_PYTHON_INSTALLER%"
)
goto :EOF
@@ -300,10 +298,12 @@ setlocal
set _url=%~1
set _dest=%~2
+echo Downloading %_url% to %_dest%...
+
PowerShell -Command ^
- "(New-Object Net.WebClient).DownloadFile('%_url%', '%_dest%')"
+ "(New-Object Net.WebClient).DownloadFile('%_url%', '%_dest%')" || exit /B 1
-if ERRORLEVEL 1 exit /B 1
+echo Downloaded %_url%
goto :EOF
@@ -317,6 +317,8 @@ setlocal
set _filename=%~1
set _expected_hash=%~2
+echo Verifying that %_filename% has MD5 hash %_expected_hash%...
+
PowerShell -Command ^
"$md5 = New-Object Security.Cryptography.MD5CryptoServiceProvider;"^
"$file = [System.IO.File]::ReadAllBytes('%_filename%');"^
@@ -328,9 +330,7 @@ PowerShell -Command ^
" Write-Host 'Invalid checksum for %_filename%.';"^
" Write-Host 'Got'$hash'; expected %_expected_hash%.';"^
" exit 1;"^
- "}"
-
-if ERRORLEVEL 1 exit /B 1
+ "}" || exit /B 1
goto :EOF
View
@@ -1,6 +1,6 @@
beanbag-docutils>=1.3
hgsubversion
-kgb
+kgb>=1.0
mock
nose
Sphinx>=1.6.1
@@ -0,0 +1,120 @@
+.. default-intersphinx:: rbt0.7
+
+
+============================
+RBTools 0.7.11 Release Notes
+============================
+
+**Release date:** January 18, 2018
+
+
+New Features
+============
+
+rbt post
+--------
+
+.. program:: rbt post
+
+* Added support for :option:`--diff-only` on all repositories.
+
+ Previously, this option only worked for Perforce. It now works for Git,
+ Subversion, and everything else, preventing any fields either computed from
+ a commit, specified in :file:`.reviewboardrc`, or specified on the command
+ line from being considered when updating a review request.
+
+* Diff sizes are now logged when posting using :option:`--debug`.
+
+ This will help us to diagnose issues sent to us when posting changes for
+ review.
+
+
+Compatibility Changes
+=====================
+
+* Git-style diffs are now used when posting changes against Mercurial
+ repositories.
+
+ Git-style diffs contain more useful information, beyond what Mercurial-style
+ diffs provide, leading to a better experience on Review Board. Tools that
+ make use of posted Mercurial diffs may be impacted if they don't understand
+ Git-style diffs.
+
+ The diffs also no longer contain the date and time that the diff was
+ generated, so that checksums are consistent across multiple generations of
+ the same diff.
+
+ Patch by André Klitzing.
+
+
+Bug Fixes
+=========
+
+rbt post
+--------
+
+.. program:: rbt post
+
+* Fix incomplete help output around :option:`--tracking-branch`'s default
+ behavior when using Git.
+
+ The old output said that on Git, ``origin/master`` will be used as the
+ default tracking branch if one is not otherwise specified. However, the
+ actual logic first attempts to use the remote branch that the current branch
+ tracks (if any). The help output has been fixed to reflect this.
+
+* Fixed a crash that could occur when checking for Subversion repositories.
+
+ When trying to determine the type of a repository, RBTools will try to check
+ if it's running in a Subversion repository. Depending on the locales chosen,
+ this could previously result in a crash.
+
+* Fixed the :option:`--diff-only` option to only update diffs.
+
+ This option has been around a long time, and was previously only for
+ Perforce. It hasn't actually worked correctly in a long time, and a recent
+ change caused some behavior that conflicted with the option, resulting in
+ Perforce change descriptions overriding the fields on a review request.
+ The option should now work as described.
+
+* Posting Subversion commits for review now automatically fills in the
+ summary and description of the review request.
+
+ Based on work by Graham Seaman.
+
+
+rbt install
+-----------
+
+* Fixed a hash validation issue when trying to install :command:`rb-tfs` on
+ Windows.
+
+ This could happen due to the zip file containing :command:`rb-tfs` being
+ interpreted as text in some cases. We now ensure we're treating the file
+ explicitly as binary when validating the hash.
+
+
+Mercurial
+---------
+
+* Fixed generating Git-compatible diffs containing empty files. (:bug:`4600`)
+
+ Patch by André Klitzing.
+
+
+Team Foundation Server
+----------------------
+
+* :command:`tf.exe` from Visual Studio 2015 no longer takes priority over
+ :command:`rb-tfs`.
+
+ This fixes problems when using RBTools on Visual Studio 2017.
+
+
+Contributors
+============
+
+* André Klitzing
+* Christian Hammond
+* David Trowbridge
+* Graham Seaman
@@ -10,6 +10,7 @@ RBTools Release Notes
.. toctree::
:maxdepth: 1
+ 0.7.11
0.7.10
0.7.9
0.7.8
View
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
import logging
import os
import re
@@ -379,7 +379,10 @@ def diff(self, revisions, include_files=[], exclude_patterns=[],
"""Return a diff across all modified files in the given revisions."""
self._init()
- diff_cmd = ['hg', 'diff', '--hidden']
+ diff_cmd = ['hg', 'diff', '--hidden', '--nodates']
+
+ if self.supports_empty_files():
+ diff_cmd.append('-g')
if self._type == 'svn':
diff_cmd.append('--svn')
@@ -394,25 +397,11 @@ def diff(self, revisions, include_files=[], exclude_patterns=[],
diff_cmd + ['-r', revisions['base'], '-r', revisions['tip']],
env=self._hg_env, log_output_on_error=False, results_unicode=False)
- supports_empty_files = self.supports_empty_files()
-
- if supports_empty_files:
- diff = self._handle_empty_files(diff, revisions['base'],
- revisions['tip'],
- exclude_files=exclude_patterns)
-
if 'parent_base' in revisions:
base_commit_id = revisions['parent_base']
parent_diff = self._execute(
diff_cmd + ['-r', base_commit_id, '-r', revisions['base']],
env=self._hg_env, results_unicode=False)
-
- if supports_empty_files:
- parent_diff = self._handle_empty_files(
- parent_diff,
- base_commit_id,
- revisions['base'],
- exclude_files=exclude_patterns)
else:
base_commit_id = revisions['base']
parent_diff = None
@@ -431,65 +420,10 @@ def diff(self, revisions, include_files=[], exclude_patterns=[],
'base_commit_id': base_commit_id,
}
- def _handle_empty_files(self, diff, base, tip, exclude_files=[]):
- """Add added and deleted 0-length files to the diff output.
-
- Since the diff output from hg diff does not give any information on
- 0-length files, we manually add this extra information to the patch.
- """
- # If the files in the base and tip changesets are the same, no files
- # (empty or otherwise) were added or deleted.
- base_files = self._get_files_in_changeset(base)
- tip_files = self._get_files_in_changeset(tip)
-
- if base_files == tip_files:
- return diff
-
- tip_empty_files = self._get_files_in_changeset(tip, get_empty=True)
- added_empty_files = tip_empty_files - base_files
-
- base_empty_files = self._get_files_in_changeset(base, get_empty=True)
- deleted_empty_files = base_empty_files - tip_files
-
- if not (added_empty_files or deleted_empty_files):
- return diff
-
- dates = execute(['hg', 'log', '-r', base, '-r', tip,
- '--template', '{date|date}\\t'],
- env=self._hg_env)
- base_date, tip_date = dates.strip().split('\t')
-
- for filename in added_empty_files:
- if filename not in exclude_files:
- diff += ('diff -r %s -r %s %s\n'
- '--- %s\t%s\n'
- '+++ b/%s\t%s\n'
- % (base, tip, filename,
- self.PRE_CREATION, self.PRE_CREATION_DATE,
- filename, tip_date)).encode('utf-8')
-
- for filename in deleted_empty_files:
- if filename not in exclude_files:
- diff += ('diff -r %s -r %s %s\n'
- '--- a/%s\t%s\n'
- '+++ %s\t%s\n'
- % (base, tip, filename,
- filename, base_date,
- self.PRE_CREATION,
- self.PRE_CREATION_DATE)).encode('utf-8')
-
- return diff
-
- def _get_files_in_changeset(self, rev, get_empty=False):
- """Return a set of all files in the specified changeset.
-
- If get_empty is True, we return only 0-length files in the changeset.
- """
+ def _get_files_in_changeset(self, rev):
+ """Return a set of all files in the specified changeset."""
cmd = ['hg', 'locate', '-r', rev]
- if get_empty:
- cmd.append('set:size(0)')
-
files = execute(cmd, env=self._hg_env, ignore_errors=True,
none_on_ignored_error=True)
View
@@ -76,7 +76,8 @@ def get_repository_info(self):
svn_info_params.append(self.options.repository_url)
data = self._run_svn(svn_info_params, ignore_errors=True,
- results_unicode=False)
+ results_unicode=False,
+ log_output_on_error=False)
m = re.search(b'^Repository Root: (.+)$', data, re.M)
if not m:
@@ -174,9 +175,10 @@ def parse_revision_spec(self, revisions=[]):
# It's not a revision--let's try a changelist. This only makes
# sense if we have a working copy.
if not self.options.repository_url:
- status = self._run_svn(['status', '--cl', str(revision),
- '--ignore-externals', '--xml'],
- results_unicode=False)
+ status = self._run_svn(
+ ['status', '--cl', six.text_type(revision),
+ '--ignore-externals', '--xml'],
+ results_unicode=False)
cl = ElementTree.fromstring(status).find('changelist')
if cl is not None:
# TODO: this should warn about mixed-revision working
@@ -255,6 +257,43 @@ def get_url_prop(path):
return get_url_prop(repository_info.path)
+ def get_raw_commit_message(self, revisions):
+ """Return the raw commit message(s) for the given revisions.
+
+ Args:
+ revisions (dict):
+ Revisions to get the commit messages for. This will contain
+ ``tip`` and ``base`` keys.
+
+ Returns:
+ unicode:
+ The commit messages for all the requested revisions.
+ """
+ base = six.text_type(revisions['base'])
+ tip = six.text_type(revisions['tip'])
+
+ if (tip == SVNClient.REVISION_WORKING_COPY or
+ tip.startswith(SVNClient.REVISION_CHANGELIST_PREFIX)):
+ return ''
+
+ command = ['-r', '%s:%s' % (base, tip)]
+
+ if getattr(self.options, 'repository_url', None):
+ command.append(self.options.repository_url)
+
+ log = self.svn_log_xml(command)
+
+ try:
+ root = ElementTree.fromstring(log)
+ except ValueError as e:
+ raise SCMError('Failed to parse svn log: %s' % e)
+
+ # We skip the first commit message, because we want commit messages
+ # corresponding to the changes that will be included in the diff.
+ messages = root.findall('.//msg')[1:]
+
+ return '\n\n'.join(message.text for message in messages)
+
def diff(self, revisions, include_files=[], exclude_patterns=[],
extra_args=[]):
"""
@@ -286,8 +325,8 @@ def diff(self, revisions, include_files=[], exclude_patterns=[],
'tip': None,
}
- base = str(revisions['base'])
- tip = str(revisions['tip'])
+ base = six.text_type(revisions['base'])
+ tip = six.text_type(revisions['tip'])
diff_cmd = ['diff', '--diff-cmd=diff', '--notice-ancestry']
changelist = None
Oops, something went wrong.

0 comments on commit ff0a04e

Please sign in to comment.