What are the exact details of the differences between the bundled Git/Mercurial versions compared to the original ones where they derived from?
Git is unchanged, it's just the binary version you can download from their site at the version number listed in the Preferences > Git page.
Mercurial has had some minor patches applied to make sure things like password prompts are fully flushed even when called by something that's not a real terminal, so SourceTree can see them and respond. The full source code is included inside SourceTree (we tell you where in the About box, but for info it's SourceTree.app/Contents/Resources/mercurial_local) to comply with the GPL, and you can diff that against the source version of Mercurial to see the changes. Obviously if you diff it against the upstream source version at the version displayed in Preferences > Mercurial you'll get just the changes we made.
That's what we do to comply with the GPL, but to make it even easier, here's the 2 patch files we apply to the embedded version. The first one isolates temporary files associated with checks to a location we can identify, so they don't make ST think that files have changed and cause an unnecessary refresh to occur
@ @propertycache def _checklink(self): - return util.checklink(self._root) + # Force checks to happen in '.hgcheck' folder so we can identify them + d = os.path.join(self._root, '.hgcheck') + try: + if not os.path.isdir(d): + os.mkdir(d) + return util.checklink(d) + except (IOError, OSError): + return False @propertycache def _checkexec(self): - return util.checkexec(self._root) + # Force checks to happen in '.hgcheck' folder so we can identify them + d = os.path.join(self._root, '.hgcheck') + try: + if not os.path.isdir(d): + os.mkdir(d) + return util.checkexec(d) + except (IOError, OSError): + return False @propertycache def _checkcase(self):
The second deals with flushing user/password prompts:
@ if not self.interactive(): return default try: - return getpass.getpass(prompt or _('password: ')) + # Ensure we flush so that we can read prompt in non-terminal + self.write_err('password:') + pwd = sys.stdin.readline() + # get rid of \r \n + if pwd and pwd[-1] == '\n': + pwd = pwd[:-1] + if pwd and pwd[-1] == '\r': + pwd = pwd[:-1] + + return pwd except EOFError: raise util.Abort(_('response expected')) def status(self, *msg, **opts):
FWIW, I've tried to submit these patches to Mercurial upstream a few times but never managed to get them in, that's why we continue to patch Mercurial for our use.
Thanks Steve. When I download Git 1.7.11.1 from http://git-scm.com/downloads, I only get a installer bundle. After install, /usr/local/git differs significantly from the bundled Git in Sourcetree (SourceTree.app/Contents/Resources/git_local). Do you have a different source of downloading Git?
Steve, where do you get the original Git from?
Steve, any update on this topic?
It looks like you're new here. Sign in or register to get started.