# HG changeset patch # User Simon Farnsworth # Date 2017-03-20 12:08:21 # Node ID d0f95ecca2ad1ab59d0dd262049a5eb1fe8fa490 # Parent 2abba5068aa13b1a8ad3404d3d059e724fdbf420 ui: restrict length of autogenerated blocked tags Long autogenerated blocked tags tend to be because the command has an absolute path; at Facebook, we've had a few where the tag is thousands of characters long (in association with the mergedriver). Change the default to use a suffix of a command as the default tag, limiting us to 85 characters (for a 100 character tag). This is long enough to overflow a standard terminal (thus be obviously autogenerated), but short enough to be readable. diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -1235,7 +1235,10 @@ class ui(object): object as exception. ''' if blockedtag is None: - blockedtag = 'unknown_system_' + cmd.translate(None, _keepalnum) + # Long cmds tend to be because of an absolute path on cmd. Keep + # the tail end instead + cmdsuffix = cmd.translate(None, _keepalnum)[-85:] + blockedtag = 'unknown_system_' + cmdsuffix out = self.fout if any(s[1] for s in self._bufferstates): out = self