# HG changeset patch # User Mads Kiilerich # Date 2014-10-03 00:20:36 # Node ID 18f6bdd1e3fc81972eb52398a295921380a98271 # Parent cb360bf4086368949a90cc01740bfef3a3e4db21 hg: make get_ref_revision('rev', '00000000000000') give the null revision It gave tip revision and caused weird pull request diffs and lots of grief when (accidentally) creating a pull request from the null revision. diff --git a/kallithea/lib/vcs/backends/hg/repository.py b/kallithea/lib/vcs/backends/hg/repository.py --- a/kallithea/lib/vcs/backends/hg/repository.py +++ b/kallithea/lib/vcs/backends/hg/repository.py @@ -452,6 +452,8 @@ class MercurialRepository(BaseRepository Returns revision number for the given reference. """ ref_name = safe_str(ref_name) + if ref_type == 'rev' and not ref_name.strip('0'): + return self.EMPTY_CHANGESET # lookup up the exact node id _revset_predicates = { 'branch': 'branch',